aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/portaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-24 14:44:15 -0700
committerChris Robinson <[email protected]>2011-08-24 14:44:15 -0700
commit7e2155d937e66dc7c4a1445bf12e64684eebb5a0 (patch)
tree4af5b1cc0f824b60e30be1d1d9cfed9216d8ac7a /Alc/backends/portaudio.c
parentc696d4dbb23461066ed741a36a83da10b6ad17f5 (diff)
Return an ALC error enum from the OpenCapture backend method
Diffstat (limited to 'Alc/backends/portaudio.c')
-rw-r--r--Alc/backends/portaudio.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/Alc/backends/portaudio.c b/Alc/backends/portaudio.c
index 606d0633..c3898ef8 100644
--- a/Alc/backends/portaudio.c
+++ b/Alc/backends/portaudio.c
@@ -278,7 +278,7 @@ static void pa_stop_playback(ALCdevice *device)
}
-static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
+static ALCenum pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
{
PaStreamParameters inParams;
ALuint frame_size;
@@ -288,22 +288,16 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
if(!deviceName)
deviceName = pa_device;
else if(strcmp(deviceName, pa_device) != 0)
- return ALC_FALSE;
+ return ALC_INVALID_VALUE;
data = (pa_data*)calloc(1, sizeof(pa_data));
if(data == NULL)
- {
- alcSetError(device, ALC_OUT_OF_MEMORY);
- return ALC_FALSE;
- }
+ return ALC_OUT_OF_MEMORY;
frame_size = FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
data->ring = CreateRingBuffer(frame_size, device->UpdateSize*device->NumUpdates);
if(data->ring == NULL)
- {
- alcSetError(device, ALC_OUT_OF_MEMORY);
goto error;
- }
inParams.device = GetConfigValueInt("port", "capture", -1);
if(inParams.device < 0)
@@ -342,12 +336,12 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
device->szDeviceName = strdup(deviceName);
device->ExtraData = data;
- return ALC_TRUE;
+ return ALC_NO_ERROR;
error:
DestroyRingBuffer(data->ring);
free(data);
- return ALC_FALSE;
+ return ALC_INVALID_VALUE;
}
static void pa_close_capture(ALCdevice *device)