aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/coreaudio.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/coreaudio.c
parent9a28402b90c596ccdc7d1a4ee93f5711637bb484 (diff)
Add a frequency-request device flag
Diffstat (limited to 'Alc/coreaudio.c')
-rw-r--r--Alc/coreaudio.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Alc/coreaudio.c b/Alc/coreaudio.c
index c0ef09c1..2ca9802b 100644
--- a/Alc/coreaudio.c
+++ b/Alc/coreaudio.c
@@ -155,11 +155,17 @@ static ALCboolean ca_reset_playback(ALCdevice *device)
return ALC_FALSE;
}
- /* set AL device's sample rate */
- device->UpdateSize = (ALuint)((ALuint64)device->UpdateSize *
- streamFormat.mSampleRate /
- device->Frequency);
- device->Frequency = streamFormat.mSampleRate;
+ if(device->Frequency != streamFormat.mSampleRate)
+ {
+ if((device->Flags&DEVICE_FREQUENCY_REQUEST))
+ AL_PRINT("CoreAudio does not support changing sample rates (wanted %dhz, got %dhz)\n", device->Frequency, streamFormat.mSampleRate);
+ device->Flags &= ~DEVICE_FREQUENCY_REQUEST;
+
+ device->UpdateSize = (ALuint)((ALuint64)device->UpdateSize *
+ streamFormat.mSampleRate /
+ device->Frequency);
+ device->Frequency = streamFormat.mSampleRate;
+ }
/* FIXME: How to tell what channels are what in the output device, and how
* to specify what we're giving? eg, 6.0 vs 5.1 */