summaryrefslogtreecommitdiffstats
path: root/Alc/portaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-09-15 23:14:14 -0700
committerChris Robinson <[email protected]>2009-09-15 23:14:14 -0700
commit307a9dd1b2ae417b11b1b5afa858f23124458dd1 (patch)
tree05ed4db9c42bf1a076ffbb3bbb6b7956e205177b /Alc/portaudio.c
parent5dff8ea82007650b908d3268850acee3e31d603a (diff)
Update the frequency with what the stream actually got set with
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r--Alc/portaudio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c
index 278434a1..57b03f40 100644
--- a/Alc/portaudio.c
+++ b/Alc/portaudio.c
@@ -42,6 +42,7 @@ MAKE_FUNC(Pa_StopStream);
MAKE_FUNC(Pa_OpenStream);
MAKE_FUNC(Pa_CloseStream);
MAKE_FUNC(Pa_GetDefaultOutputDevice);
+MAKE_FUNC(Pa_GetStreamInfo);
#undef MAKE_FUNC
@@ -69,6 +70,7 @@ static int pa_callback(const void *inputBuffer, void *outputBuffer,
static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName)
{
+ const PaStreamInfo *streamInfo;
PaStreamParameters outParams;
pa_data *data;
int periods;
@@ -123,6 +125,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName)
free(data);
return ALC_FALSE;
}
+ streamInfo = pPa_GetStreamInfo(data->stream);
err = pPa_StartStream(data->stream);
if(err != paNoError)
@@ -136,6 +139,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName)
device->szDeviceName = strdup(deviceName);
device->UpdateSize = device->BufferSize/periods;
+ device->Frequency = streamInfo->sampleRate;
return ALC_TRUE;
}
@@ -233,6 +237,7 @@ void alc_pa_init(BackendFuncs *func_list)
LOAD_FUNC(Pa_OpenStream);
LOAD_FUNC(Pa_CloseStream);
LOAD_FUNC(Pa_GetDefaultOutputDevice);
+ LOAD_FUNC(Pa_GetStreamInfo);
#undef LOAD_FUNC
if((err=pPa_Initialize()) != paNoError)