aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-16 00:08:11 -0700
committerChris Robinson <[email protected]>2009-09-16 00:08:11 -0700
commitffff10455435908e7975110c685cca78cebe5769 (patch)
treef317b019a8d7f317be11eaf0f0a5576b2e5e88b8 /Alc
parent307a9dd1b2ae417b11b1b5afa858f23124458dd1 (diff)
Restore the device frequency using the stream info
Diffstat (limited to 'Alc')
-rw-r--r--Alc/portaudio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c
index 57b03f40..875b01ee 100644
--- a/Alc/portaudio.c
+++ b/Alc/portaudio.c
@@ -150,7 +150,7 @@ static void pa_close_playback(ALCdevice *device)
err = pPa_StopStream(data->stream);
if(err != paNoError)
- fprintf(stderr, "Error stopping stream: %s\n", pPa_GetErrorText(err));
+ fprintf(stderr, "Error stopping stream: %s\n", pPa_GetErrorText(err));
err = pPa_CloseStream(data->stream);
if(err != paNoError)
@@ -162,8 +162,14 @@ static void pa_close_playback(ALCdevice *device)
static ALCboolean pa_start_context(ALCdevice *device, ALCcontext *context)
{
- device->Frequency = context->Frequency;
+ pa_data *data = (pa_data*)device->ExtraData;
+ const PaStreamInfo *streamInfo;
+
+ streamInfo = pPa_GetStreamInfo(data->stream);
+ device->Frequency = streamInfo->sampleRate;
+
return ALC_TRUE;
+ (void)context;
}
static void pa_stop_context(ALCdevice *device, ALCcontext *context)