aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2012-03-08 15:26:23 +1300
committerMatthew Gregan <[email protected]>2012-03-08 15:26:23 +1300
commit97b8e162a8e887016325a58348fc819348e77726 (patch)
tree8ec3daa7d381ec675760d9789477a50e057cbe59 /src
parent6540d32b8f032f1c0321be3682e0e1479129d328 (diff)
downloadcubeb-97b8e162a8e887016325a58348fc819348e77726.tar.gz
cubeb-97b8e162a8e887016325a58348fc819348e77726.zip
audioqueue,audiounit,directsound,pulse: minor cleanups.
Diffstat (limited to 'src')
-rw-r--r--src/cubeb_audioqueue.c1
-rw-r--r--src/cubeb_audiounit.c1
-rw-r--r--src/cubeb_directsound.cpp5
-rw-r--r--src/cubeb_pulse.c4
4 files changed, 11 insertions, 0 deletions
diff --git a/src/cubeb_audioqueue.c b/src/cubeb_audioqueue.c
index dd97167..9eac87a 100644
--- a/src/cubeb_audioqueue.c
+++ b/src/cubeb_audioqueue.c
@@ -98,6 +98,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
int i;
assert(context == (void *) 0xdeadbeef);
+ *stream = NULL;
if (stream_params.rate < 1 || stream_params.rate > 192000 ||
stream_params.channels < 1 || stream_params.channels > 32 ||
diff --git a/src/cubeb_audiounit.c b/src/cubeb_audiounit.c
index a220cba..edec67f 100644
--- a/src/cubeb_audiounit.c
+++ b/src/cubeb_audiounit.c
@@ -102,6 +102,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
OSStatus r;
assert(context == (void *) 0xdeadbeef);
+ *stream = NULL;
if (stream_params.rate < 1 || stream_params.rate > 192000 ||
stream_params.channels < 1 || stream_params.channels > 32 ||
diff --git a/src/cubeb_directsound.cpp b/src/cubeb_directsound.cpp
index ea6b9a8..247d202 100644
--- a/src/cubeb_directsound.cpp
+++ b/src/cubeb_directsound.cpp
@@ -243,6 +243,8 @@ cubeb_init(cubeb ** context, char const * context_name)
{
cubeb * ctx;
+ *context = NULL;
+
ctx = (cubeb *) calloc(1, sizeof(*ctx));
/* register a hidden window for DirectSound's SetCooperativeLevel */
@@ -347,6 +349,9 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
{
struct cubeb_list_node * node;
+ assert(context);
+ *stream = NULL;
+
if (stream_params.rate < 1 || stream_params.rate > 192000 ||
stream_params.channels < 1 || stream_params.channels > 32 ||
latency < 1 || latency > 2000) {
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c
index 5409226..26857f7 100644
--- a/src/cubeb_pulse.c
+++ b/src/cubeb_pulse.c
@@ -189,6 +189,8 @@ cubeb_init(cubeb ** context, char const * context_name)
{
cubeb * ctx;
+ *context = NULL;
+
ctx = calloc(1, sizeof(*ctx));
ctx->mainloop = pa_threaded_mainloop_new();
@@ -245,6 +247,8 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
pa_buffer_attr battr;
pa_channel_map map;
+ *stream = NULL;
+
if (stream_params.rate < 1 || stream_params.rate > 192000 ||
stream_params.channels < 1 || stream_params.channels > 32 ||
latency < 1 || latency > 2000) {