mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
pulsesrc: additional error condition checking
This commit is contained in:
parent
3168b77e04
commit
e44d930289
1 changed files with 21 additions and 4 deletions
|
@ -1677,10 +1677,13 @@ gst_pulsesrc_change_state (GstElement * element, GstStateChange transition)
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
this->mainloop = pa_threaded_mainloop_new ();
|
if (!(this->mainloop = pa_threaded_mainloop_new ()))
|
||||||
g_assert (this->mainloop);
|
goto mainloop_failed;
|
||||||
|
if (pa_threaded_mainloop_start (this->mainloop) < 0) {
|
||||||
pa_threaded_mainloop_start (this->mainloop);
|
pa_threaded_mainloop_free (this->mainloop);
|
||||||
|
this->mainloop = NULL;
|
||||||
|
goto mainloop_start_failed;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this->mixer)
|
if (!this->mixer)
|
||||||
this->mixer =
|
this->mixer =
|
||||||
|
@ -1730,4 +1733,18 @@ gst_pulsesrc_change_state (GstElement * element, GstStateChange transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
mainloop_failed:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (this, RESOURCE, FAILED,
|
||||||
|
("pa_threaded_mainloop_new() failed"), (NULL));
|
||||||
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
|
}
|
||||||
|
mainloop_start_failed:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (this, RESOURCE, FAILED,
|
||||||
|
("pa_threaded_mainloop_start() failed"), (NULL));
|
||||||
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue