aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-01-17 15:55:37 -0800
committerChris Robinson <[email protected]>2012-01-17 15:55:37 -0800
commit5a2a5342403ca99a4613a56f69c95ed5ce91f8b2 (patch)
treeb28e61dbcb04968d0212b5c57530bec0b00f0d83
parent09258ca5c1e6b19392f3657b817c6328ef5b569a (diff)
Report parameter request changes in UpdateDeviceParams
-rw-r--r--Alc/ALc.c62
1 files changed, 44 insertions, 18 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index b6a01c57..3505bfc4 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1139,26 +1139,52 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if((device->Flags&DEVICE_RUNNING))
return ALC_TRUE;
-
- LockDevice(device);
- TRACE("Format pre-setup: %s%s, %s, %uhz%s, %u update size x%d\n",
- DevFmtChannelsString(device->FmtChans),
- (device->Flags&DEVICE_CHANNELS_REQUEST)?" (requested)":"",
- DevFmtTypeString(device->FmtType), device->Frequency,
- (device->Flags&DEVICE_FREQUENCY_REQUEST)?" (requested)":"",
- device->UpdateSize, device->NumUpdates);
- if(ALCdevice_ResetPlayback(device) == ALC_FALSE)
+ else
{
- UnlockDevice(device);
- return ALC_FALSE;
+ enum DevFmtChannels schans;
+ enum DevFmtType stype;
+ ALCuint freq;
+
+ LockDevice(device);
+
+ freq = device->Frequency;
+ schans = device->FmtChans;
+ stype = device->FmtType;
+
+ TRACE("Format pre-setup: %s%s, %s, %uhz%s, %u update size x%d\n",
+ DevFmtChannelsString(device->FmtChans),
+ (device->Flags&DEVICE_CHANNELS_REQUEST)?" (requested)":"",
+ DevFmtTypeString(device->FmtType), device->Frequency,
+ (device->Flags&DEVICE_FREQUENCY_REQUEST)?" (requested)":"",
+ device->UpdateSize, device->NumUpdates);
+ if(ALCdevice_ResetPlayback(device) == ALC_FALSE)
+ {
+ UnlockDevice(device);
+ return ALC_FALSE;
+ }
+ device->Flags |= DEVICE_RUNNING;
+
+ if(device->FmtChans != schans)
+ {
+ if((device->Flags&DEVICE_CHANNELS_REQUEST))
+ ERR("Failed to set %s, got %s instead\n",
+ DevFmtChannelsString(schans),
+ DevFmtChannelsString(device->FmtChans));
+ device->Flags &= ~DEVICE_CHANNELS_REQUEST;
+ }
+ if(device->Frequency != freq)
+ {
+ if((device->Flags&DEVICE_FREQUENCY_REQUEST))
+ ERR("Failed to set %uhz, got %uhz instead\n",
+ freq, device->Frequency);
+ device->Flags &= ~DEVICE_FREQUENCY_REQUEST;
+ }
+
+ TRACE("Format post-setup: %s, %s, %uhz, %u update size x%d\n",
+ DevFmtChannelsString(device->FmtChans),
+ DevFmtTypeString(device->FmtType), device->Frequency,
+ device->UpdateSize, device->NumUpdates);
}
- device->Flags |= DEVICE_RUNNING;
- TRACE("Format post-setup: %s%s, %s, %uhz%s, %u update size x%d\n",
- DevFmtChannelsString(device->FmtChans),
- (device->Flags&DEVICE_CHANNELS_REQUEST)?" (requested)":"",
- DevFmtTypeString(device->FmtType), device->Frequency,
- (device->Flags&DEVICE_FREQUENCY_REQUEST)?" (requested)":"",
- device->UpdateSize, device->NumUpdates);
aluInitPanning(device);