From 7e06a10f73d5955de7bba35da09e5941cee56dc8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 18 Sep 2011 16:16:55 -0700 Subject: Return int and float config values through a parameter This allows the getter functions to return whether or not the option exists without a separate call and check. --- Alc/backends/portaudio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/portaudio.c b/Alc/backends/portaudio.c index 2345a282..8070942c 100644 --- a/Alc/backends/portaudio.c +++ b/Alc/backends/portaudio.c @@ -168,8 +168,8 @@ static ALCenum pa_open_playback(ALCdevice *device, const ALCchar *deviceName) device->ExtraData = data; - outParams.device = GetConfigValueInt("port", "device", -1); - if(outParams.device < 0) + outParams.device = -1; + if(!ConfigValueInt("port", "device", &outParams.device) || outParams.device < 0) outParams.device = Pa_GetDefaultOutputDevice(); outParams.suggestedLatency = (device->UpdateSize*device->NumUpdates) / (float)device->Frequency; @@ -299,8 +299,8 @@ static ALCenum pa_open_capture(ALCdevice *device, const ALCchar *deviceName) if(data->ring == NULL) goto error; - inParams.device = GetConfigValueInt("port", "capture", -1); - if(inParams.device < 0) + inParams.device = -1; + if(!ConfigValueInt("port", "capture", &inParams.device) || inParams.device < 0) inParams.device = Pa_GetDefaultOutputDevice(); inParams.suggestedLatency = 0.0f; inParams.hostApiSpecificStreamInfo = NULL; -- cgit v1.2.3