aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/coreaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-03 17:11:07 -0700
committerChris Robinson <[email protected]>2011-05-03 17:11:07 -0700
commit679f2480c9a66905b0a03c99e099b59bfd07879d (patch)
tree186219bf7fc0b39eba0f04b2e4ede23c57a57260 /Alc/coreaudio.c
parentdb7ca2c7ca48026261c59095331ae2a098083c7a (diff)
Add a device flag for channel config requests
Diffstat (limited to 'Alc/coreaudio.c')
-rw-r--r--Alc/coreaudio.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/Alc/coreaudio.c b/Alc/coreaudio.c
index 2ca9802b..1d086926 100644
--- a/Alc/coreaudio.c
+++ b/Alc/coreaudio.c
@@ -172,25 +172,62 @@ static ALCboolean ca_reset_playback(ALCdevice *device)
switch(streamFormat.mChannelsPerFrame)
{
case 1:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtMono)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got mono instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtMono;
break;
case 2:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtStereo)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got stereo instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtStereo;
break;
case 4:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtQuad)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got quad instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtQuad;
break;
case 6:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtX51)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got 5.1 instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtX51;
break;
case 7:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtX61)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got 6.1 instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtX61;
break;
case 8:
+ if((device->Flags&DEVICE_CHANNELS_REQUEST) &&
+ device->FmtChans != DevFmtX71)
+ {
+ AL_PRINT("Failed to set requested channel config %#x, got 7.1 instead\n", device->FmtChans);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
device->FmtChans = DevFmtX71;
break;
default:
AL_PRINT("Unhandled channel count (%d), using stereo\n", streamFormat.mChannelsPerFrame);
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
device->FmtChans = DevFmtStereo;
streamFormat.mChannelsPerFrame = 2;
break;