aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/wave.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-27 18:55:18 -0700
committerChris Robinson <[email protected]>2009-08-27 18:55:18 -0700
commit832dc8a5857ff492502f23f9604d1b3e27718e24 (patch)
tree67d528eb5933372ce10b6c7e11df7b5fe48839dc /Alc/wave.c
parentbb121e68a618d1881a6e35c47938ce0650d07afb (diff)
Remove unnecessary vars and rework device name checks
Diffstat (limited to 'Alc/wave.c')
-rw-r--r--Alc/wave.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/Alc/wave.c b/Alc/wave.c
index d960588c..4ced5baf 100644
--- a/Alc/wave.c
+++ b/Alc/wave.c
@@ -108,7 +108,6 @@ static ALuint WaveProc(ALvoid *ptr)
static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceName)
{
- const char *devName = waveDevice;
wave_data *data;
const char *fname;
@@ -116,12 +115,10 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam
if(!fname[0])
return ALC_FALSE;
- if(deviceName)
- {
- if(strcmp(deviceName, waveDevice) != 0)
- return ALC_FALSE;
- devName = waveDevice;
- }
+ if(!deviceName)
+ deviceName = waveDevice;
+ else if(strcmp(deviceName, waveDevice) != 0)
+ return ALC_FALSE;
data = (wave_data*)calloc(1, sizeof(wave_data));
@@ -133,7 +130,7 @@ static ALCboolean wave_open_playback(ALCdevice *device, const ALCchar *deviceNam
return ALC_FALSE;
}
- device->szDeviceName = strdup(devName);
+ device->szDeviceName = strdup(deviceName);
device->ExtraData = data;
return ALC_TRUE;
}