Commit 3168b77e authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

pulsesink: additional error condition checking

parent ad11ec41
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment