diff options
author | Chris Robinson <[email protected]> | 2011-09-18 16:16:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-18 16:16:55 -0700 |
commit | 7e06a10f73d5955de7bba35da09e5941cee56dc8 (patch) | |
tree | 4e2394246a4912ee762c7a01fa365cceade58e50 /Alc/backends | |
parent | d46db2f648e7d00ae138fb98bd0ee49014c501a6 (diff) |
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.
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/portaudio.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; |