gstpad: Release pending g_cond_wait() when stopping/pausing task

Otherwise we would deadlock waiting forever for the streaming lock
to be released

https://bugzilla.gnome.org/show_bug.cgi?id=792341
This commit is contained in:
Edward Hervey 2018-01-15 18:13:45 +01:00 committed by Edward Hervey
parent 33e7269c37
commit 6cd783b9fc

View file

@ -6134,6 +6134,9 @@ gst_pad_pause_task (GstPad * pad)
if (task == NULL)
goto no_task;
res = gst_task_set_state (task, GST_TASK_PAUSED);
/* unblock activation waits if any */
pad->priv->in_activation = FALSE;
g_cond_broadcast (&pad->priv->activation_cond);
GST_OBJECT_UNLOCK (pad);
/* wait for task function to finish, this lock is recursive so it does nothing
@ -6219,6 +6222,9 @@ gst_pad_stop_task (GstPad * pad)
goto no_task;
GST_PAD_TASK (pad) = NULL;
res = gst_task_set_state (task, GST_TASK_STOPPED);
/* unblock activation waits if any */
pad->priv->in_activation = FALSE;
g_cond_broadcast (&pad->priv->activation_cond);
GST_OBJECT_UNLOCK (pad);
GST_PAD_STREAM_LOCK (pad);