diff options
author | Chris Robinson <[email protected]> | 2009-08-27 18:55:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-27 18:55:18 -0700 |
commit | 832dc8a5857ff492502f23f9604d1b3e27718e24 (patch) | |
tree | 67d528eb5933372ce10b6c7e11df7b5fe48839dc /Alc/dsound.c | |
parent | bb121e68a618d1881a6e35c47938ce0650d07afb (diff) |
Remove unnecessary vars and rework device name checks
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r-- | Alc/dsound.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c index bbd9bf0b..5ac1e530 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -153,21 +153,21 @@ static ALuint DSoundProc(ALvoid *ptr) static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName) { DSoundData *pData = NULL; - const char *devName; LPGUID guid = NULL; HRESULT hr; if(ds_handle == NULL) return ALC_FALSE; - if(deviceName && strcmp(deviceName, dsDevice) != 0) + if(!deviceName) + deviceName = dsDevice; + else if(strcmp(deviceName, dsDevice) != 0) { ALuint i; for(i = 0;i < NumDevices;i++) { if(strcmp(deviceName, DeviceList[i].name) == 0) { - devName = DeviceList[i].name; guid = &DeviceList[i].guid; break; } @@ -175,8 +175,6 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam if(i == NumDevices) return ALC_FALSE; } - else - devName = dsDevice; //Initialise requested device @@ -199,7 +197,7 @@ static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceNam return ALC_FALSE; } - device->szDeviceName = strdup(devName); + device->szDeviceName = strdup(deviceName); device->ExtraData = pData; return ALC_TRUE; } @@ -535,7 +533,7 @@ void alcDSoundProbe(int type) return; if(type == DEVICE_PROBE) - AppendDeviceList(DeviceList[0].name); + AppendDeviceList(dsDevice); else if(type == ALL_DEVICE_PROBE) { for(i = 0;i < NumDevices;++i) |