mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
pulsesink: additional error condition checking
This commit is contained in:
parent
ad11ec4121
commit
3168b77e04
1 changed files with 11 additions and 1 deletions
|
@ -2955,8 +2955,11 @@ gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
|
|||
GST_INFO_OBJECT (element, "new pa main loop thread");
|
||||
if (!(mainloop = pa_threaded_mainloop_new ()))
|
||||
goto mainloop_failed;
|
||||
if (pa_threaded_mainloop_start (mainloop) < 0) {
|
||||
pa_threaded_mainloop_free (mainloop);
|
||||
goto mainloop_start_failed;
|
||||
}
|
||||
mainloop_ref_ct = 1;
|
||||
pa_threaded_mainloop_start (mainloop);
|
||||
g_mutex_unlock (pa_shared_resource_mutex);
|
||||
} else {
|
||||
GST_INFO_OBJECT (element, "reusing pa main loop thread");
|
||||
|
@ -3002,6 +3005,13 @@ mainloop_failed:
|
|||
("pa_threaded_mainloop_new() failed"), (NULL));
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
mainloop_start_failed:
|
||||
{
|
||||
g_mutex_unlock (pa_shared_resource_mutex);
|
||||
GST_ELEMENT_ERROR (pulsesink, RESOURCE, FAILED,
|
||||
("pa_threaded_mainloop_start() failed"), (NULL));
|
||||
return GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
state_failure:
|
||||
{
|
||||
if (transition == GST_STATE_CHANGE_NULL_TO_READY) {
|
||||
|
|
Loading…
Reference in a new issue