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
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 39303ba..7137db2 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -6134,6 +6134,9 @@
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 @@
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);