aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/portaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-03 02:29:26 -0700
committerChris Robinson <[email protected]>2011-05-03 02:29:26 -0700
commitba236ad1084ffc99890f0301f444ddc7d63a64e1 (patch)
tree57c2cb594091d19ff86485d2a9039e69ad595778 /Alc/portaudio.c
parent9a28402b90c596ccdc7d1a4ee93f5711637bb484 (diff)
Add a frequency-request device flag
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r--Alc/portaudio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c
index 77c7236f..b144973a 100644
--- a/Alc/portaudio.c
+++ b/Alc/portaudio.c
@@ -249,7 +249,13 @@ static ALCboolean pa_reset_playback(ALCdevice *device)
PaError err;
streamInfo = pPa_GetStreamInfo(data->stream);
- device->Frequency = streamInfo->sampleRate;
+ if(device->Frequency != streamInfo->sampleRate)
+ {
+ if((device->Flags&DEVICE_FREQUENCY_REQUEST))
+ AL_PRINT("PortAudio does not support changing sample rates (wanted %dhz, got %.1fhz)\n", device->Frequency, streamInfo->sampleRate);
+ device->Flags &= ~DEVICE_FREQUENCY_REQUEST;
+ device->Frequency = streamInfo->sampleRate;
+ }
device->UpdateSize = data->update_size;
err = pPa_StartStream(data->stream);