summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-17 00:05:10 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-10-17 08:48:23 +0200
commit48c3bd303f607d2f468ccad96098bfd0ad8f7143 (patch)
treef9e30f8dd1e976708ba4f55c76a8b9b1aec18a4e /ext
parent3188f5699b74f84126455c6e14836128bfae6f86 (diff)
pulse: mainloop creation can fail too, so handle that
Diffstat (limited to 'ext')
-rw-r--r--ext/pulse/pulsemixerctrl.c10
-rw-r--r--ext/pulse/pulseprobe.c12
2 files changed, 16 insertions, 6 deletions
diff --git a/ext/pulse/pulsemixerctrl.c b/ext/pulse/pulsemixerctrl.c
index 8df08407..591337bf 100644
--- a/ext/pulse/pulsemixerctrl.c
+++ b/ext/pulse/pulsemixerctrl.c
@@ -213,7 +213,7 @@ static gboolean
gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
{
int e;
- gchar *name = gst_pulse_client_name ();
+ gchar *name;
pa_operation *o = NULL;
g_assert (c);
@@ -221,10 +221,14 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
GST_DEBUG_OBJECT (c->object, "ctrl open");
c->mainloop = pa_threaded_mainloop_new ();
- g_assert (c->mainloop);
+ if (!c->mainloop)
+ return FALSE;
e = pa_threaded_mainloop_start (c->mainloop);
- g_assert (e == 0);
+ if (e < 0)
+ return FALSE;
+
+ name = gst_pulse_client_name ();
pa_threaded_mainloop_lock (c->mainloop);
diff --git a/ext/pulse/pulseprobe.c b/ext/pulse/pulseprobe.c
index b393b2c2..6ebbfb21 100644
--- a/ext/pulse/pulseprobe.c
+++ b/ext/pulse/pulseprobe.c
@@ -1,3 +1,5 @@
+/*-*- Mode: C; c-basic-offset: 2 -*-*/
+
/*
* GStreamer pulseaudio plugin
*
@@ -99,17 +101,21 @@ static gboolean
gst_pulseprobe_open (GstPulseProbe * c)
{
int e;
- gchar *name = gst_pulse_client_name ();
+ gchar *name;
g_assert (c);
GST_DEBUG_OBJECT (c->object, "probe open");
c->mainloop = pa_threaded_mainloop_new ();
- g_assert (c->mainloop);
+ if (!c->mainloop)
+ return FALSE;
e = pa_threaded_mainloop_start (c->mainloop);
- g_assert (e == 0);
+ if (e < 0)
+ return FALSE;
+
+ name = gst_pulse_client_name ();
pa_threaded_mainloop_lock (c->mainloop);