Commit e6d94932 authored by Edward Hervey's avatar Edward Hervey 🤘
Browse files

collectpads: Don't forward FLUSH_STOP if some input streams are still flushing.

This guarantees that only one FLUSH_STOP event (the last one) will be sent
downstream when a flushing seek is being done through collectpads.
parent ed18ceff
...@@ -506,6 +506,27 @@ gst_collect_pads_collect_range (GstCollectPads * pads, guint64 offset, ...@@ -506,6 +506,27 @@ gst_collect_pads_collect_range (GstCollectPads * pads, guint64 offset,
return GST_FLOW_NOT_SUPPORTED; return GST_FLOW_NOT_SUPPORTED;
} }
static gboolean
gst_collect_pads_is_flushing (GstCollectPads * pads)
{
GSList *walk = pads->data;
gboolean res = TRUE;
GST_COLLECT_PADS_PAD_LOCK (pads);
while (walk) {
GstCollectData *cdata = walk->data;
if (cdata->abidata.ABI.flushing)
goto done;
walk = g_slist_next (walk);
}
res = FALSE;
done:
GST_COLLECT_PADS_PAD_UNLOCK (pads);
return res;
}
/* FIXME, I think this function is used to work around bad behaviour /* FIXME, I think this function is used to work around bad behaviour
* of elements that add pads to themselves without activating them. * of elements that add pads to themselves without activating them.
* *
...@@ -1123,8 +1144,11 @@ gst_collect_pads_event (GstPad * pad, GstEvent * event) ...@@ -1123,8 +1144,11 @@ gst_collect_pads_event (GstPad * pad, GstEvent * event)
} }
GST_OBJECT_UNLOCK (pads); GST_OBJECT_UNLOCK (pads);
/* forward event */ if (!gst_collect_pads_is_flushing (pads))
goto forward; /* forward event if all pads are no longer flushing */
goto forward;
gst_event_unref (event);
goto done;
} }
case GST_EVENT_EOS: case GST_EVENT_EOS:
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment