mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
pulse: mainloop creation can fail too, so handle that
This commit is contained in:
parent
3188f5699b
commit
48c3bd303f
2 changed files with 16 additions and 6 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue