aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/coreaudio.c
diff options
context:
space:
mode:
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 */