From ffff10455435908e7975110c685cca78cebe5769 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 16 Sep 2009 00:08:11 -0700 Subject: Restore the device frequency using the stream info --- Alc/portaudio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Alc') 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) -- cgit v1.2.3