summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-12-13 20:00:55 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-12-13 21:03:54 +0200
commit33c239828bd0563114fddb4fece75f95a986d41e (patch)
treef46fe5ae93128a7abe033cf55c7d290c5ad8c7ff /plugins
parent96304d613f664fd749f87939c5be40f86e5d0f2a (diff)
queue/queue2: Ensure that the streaming thread is unlocked after deactivating the srcpad
It might happen that the srcpad task function is never called at all, in which case unlocking everything from there will never happen. Make sure to unlock everything another time after the task function is definitely stopped. https://bugzilla.gnome.org/show_bug.cgi?id=776039
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstqueue.c4
-rw-r--r--plugins/elements/gstqueue2.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c
index c3176b971..1f0c09cf1 100644
--- a/plugins/elements/gstqueue.c
+++ b/plugins/elements/gstqueue.c
@@ -1729,6 +1729,10 @@ gst_queue_src_activate_mode (GstPad * pad, GstObject * parent, GstPadMode mode,
/* step 2, make sure streaming finishes */
result = gst_pad_stop_task (pad);
+
+ GST_QUEUE_MUTEX_LOCK (queue);
+ gst_queue_locked_flush (queue, FALSE);
+ GST_QUEUE_MUTEX_UNLOCK (queue);
}
break;
default:
diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c
index 478a107ea..4c670a024 100644
--- a/plugins/elements/gstqueue2.c
+++ b/plugins/elements/gstqueue2.c
@@ -3509,6 +3509,10 @@ gst_queue2_src_activate_push (GstPad * pad, GstObject * parent, gboolean active)
/* step 2, make sure streaming finishes */
result = gst_pad_stop_task (pad);
+
+ GST_QUEUE2_MUTEX_LOCK (queue);
+ gst_queue2_locked_flush (queue, FALSE, FALSE);
+ GST_QUEUE2_MUTEX_UNLOCK (queue);
}
return result;