Remove an unnecessary else statement

This commit is contained in:
Chris Robinson
2012-01-20 12:20:24 -08:00
parent 2b2ce8bf3b
commit b375897374
+41 -44
View File
@@ -1043,6 +1043,9 @@ static void alcSetError(ALCdevice *device, ALCenum errorCode)
static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
{
ALCcontext *context;
enum DevFmtChannels oldChans;
enum DevFmtType oldType;
ALCuint oldFreq;
int oldMode;
ALuint i;
@@ -1148,52 +1151,46 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if((device->Flags&DEVICE_RUNNING))
return ALC_TRUE;
else
LockDevice(device);
oldFreq = device->Frequency;
oldChans = device->FmtChans;
oldType = 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)
{
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);
UnlockDevice(device);
return ALC_FALSE;
}
device->Flags |= DEVICE_RUNNING;
if(device->FmtChans != oldChans)
{
if((device->Flags&DEVICE_CHANNELS_REQUEST))
ERR("Failed to set %s, got %s instead\n",
DevFmtChannelsString(oldChans),
DevFmtChannelsString(device->FmtChans));
device->Flags &= ~DEVICE_CHANNELS_REQUEST;
}
if(device->Frequency != oldFreq)
{
if((device->Flags&DEVICE_FREQUENCY_REQUEST))
ERR("Failed to set %uhz, got %uhz instead\n",
oldFreq, 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);
aluInitPanning(device);