diff options
author | Chris Robinson <[email protected]> | 2009-09-16 22:58:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-16 22:58:54 -0700 |
commit | cbcaa54173bf6b14435adf3daf9feb2fa2e37d04 (patch) | |
tree | a56832a1ee9f96e72ac03a0424893714794cae4a /Alc/portaudio.c | |
parent | 94e3fca7022c5c7f8147200ffdb3cda5ded62488 (diff) |
Store the number of periods in the device instead of the buffer size
Also keep all the fields in sync
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r-- | Alc/portaudio.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 50039286..e7330999 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -90,7 +90,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) outParams.device = GetConfigValueInt("port", "device", -1); if(outParams.device < 0) outParams.device = pPa_GetDefaultOutputDevice(); - outParams.suggestedLatency = (float)device->BufferSize / + outParams.suggestedLatency = (device->UpdateSize*device->NumUpdates) / (float)device->Frequency; outParams.hostApiSpecificStreamInfo = NULL; @@ -116,8 +116,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName) outParams.channelCount = aluChannelsFromFormat(device->Format); err = pPa_OpenStream(&data->stream, NULL, &outParams, device->Frequency, - device->BufferSize/periods, paNoFlag, - pa_callback, device); + device->UpdateSize, paNoFlag, pa_callback, device); if(err != paNoError) { AL_PRINT("Pa_OpenStream() returned an error: %s\n", pPa_GetErrorText(err)); @@ -138,7 +137,6 @@ 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; } |