aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/portaudio.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/portaudio.c
parentbb121e68a618d1881a6e35c47938ce0650d07afb (diff)
Remove unnecessary vars and rework device name checks
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r--Alc/portaudio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c
index a8a8ceb5..0142cac3 100644
--- a/Alc/portaudio.c
+++ b/Alc/portaudio.c
@@ -83,11 +83,10 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName)
if(pa_handle == NULL)
return ALC_FALSE;
- if(deviceName)
- {
- if(strcmp(deviceName, pa_device) != 0)
- return ALC_FALSE;
- }
+ if(!deviceName)
+ deviceName = pa_device;
+ else if(strcmp(deviceName, pa_device) != 0)
+ return ALC_FALSE;
data = (pa_data*)calloc(1, sizeof(pa_data));
device->ExtraData = data;
@@ -141,7 +140,7 @@ static ALCboolean pa_open_playback(ALCdevice *device, const ALCchar *deviceName)
return ALC_FALSE;
}
- device->szDeviceName = strdup(pa_device);
+ device->szDeviceName = strdup(deviceName);
device->UpdateSize = device->BufferSize/periods;
return ALC_TRUE;
}