pulsesink: additional error condition checking

This commit is contained in:
Mark Nauwelaerts 2012-01-20 16:46:21 +01:00
parent ad11ec4121
commit 3168b77e04

View file

@ -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) {