aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-01-20 12:20:24 -0800
committerChris Robinson <[email protected]>2012-01-20 12:20:24 -0800
commitb375897374efa8a80d3324519ce1cda8de0c8044 (patch)
tree9a82cd4b980f0091d2c7884e24fce18a043c9562
parent2b2ce8bf3b89793f0bd555675eccc89875b8e8a2 (diff)
Remove an unnecessary else statement
-rw-r--r--Alc/ALc.c79
1 files changed, 38 insertions, 41 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index ff22ad01..e0cb3efc 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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
- {
- enum DevFmtChannels schans;
- enum DevFmtType stype;
- ALCuint freq;
-
- LockDevice(device);
- freq = device->Frequency;
- schans = device->FmtChans;
- stype = device->FmtType;
+ 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)
- {
- UnlockDevice(device);
- return ALC_FALSE;
- }
- device->Flags |= DEVICE_RUNNING;
+ oldFreq = device->Frequency;
+ oldChans = device->FmtChans;
+ oldType = device->FmtType;
- 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 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;
- 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);
+ 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);