From c955ddc712f3b4de9ef5d822b95a6f4bd9985eb3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Apr 2013 19:06:35 +0200 Subject: [PATCH] queue: start pushing again on RECONFIGURE When we got NOT_LINKED before and we receive a RECONFIGURE event, start pushing again on the source pad. See https://bugzilla.gnome.org/show_bug.cgi?id=676304 --- plugins/elements/gstqueue.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 5223ae0f74..e0e70302f3 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -1249,7 +1249,24 @@ gst_queue_handle_src_event (GstPad * pad, GstObject * parent, GstEvent * event) event, GST_EVENT_TYPE (event)); #endif - res = gst_pad_push_event (queue->sinkpad, event); + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_RECONFIGURE: + GST_QUEUE_MUTEX_LOCK (queue); + if (queue->srcresult == GST_FLOW_NOT_LINKED) { + /* when we got not linked, assume downstream is linked again now and we + * can try to start pushing again */ + queue->srcresult = GST_FLOW_OK; + gst_pad_start_task (pad, (GstTaskFunction) gst_queue_loop, pad, NULL); + } + GST_QUEUE_MUTEX_UNLOCK (queue); + + res = gst_pad_push_event (queue->sinkpad, event); + break; + default: + res = gst_pad_event_default (pad, parent, event); + break; + } + return res; }