Commit 5b3ee70e authored by Srimanta Panda's avatar Srimanta Panda Committed by Olivier Crête

Fix funnel EOS handling and wrong unittest

When no data is coming from sinkpads and eos events
arrived at one of the sinkpad, funnel forwards the EOS
event to downstream. It forwards the EOS because lastsink pad
is NULL. Also the unit testcase of the funnel is not checking
the correct behavior as it should. The unit test case should
fail if one of the sink pad has already EOS present on it and
we are trying to push one more EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=731716
parent bc75a166
......@@ -260,10 +260,13 @@ gst_funnel_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
unlock = TRUE;
GST_PAD_STREAM_LOCK (funnel->srcpad);
if ((GST_EVENT_TYPE (event) == GST_EVENT_EOS) &&
(!gst_funnel_all_sinkpads_eos_unlocked (funnel, pad))) {
forward = FALSE;
} else if (funnel->last_sinkpad && (pad != funnel->last_sinkpad)) {
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
if (!gst_funnel_all_sinkpads_eos_unlocked (funnel, pad)) {
forward = FALSE;
} else {
forward = TRUE;
}
} else if (pad != funnel->last_sinkpad) {
forward = FALSE;
}
}
......
......@@ -204,7 +204,7 @@ GST_START_TEST (test_funnel_eos)
td.funnelsink11)));
/* This will fail because everything is EOS already */
fail_unless (gst_pad_push_event (td.mysrc1, gst_event_new_eos ()));
fail_if (gst_pad_push_event (td.mysrc1, gst_event_new_eos ()));
fail_unless (num_eos == 2);
fail_unless (gst_pad_unlink (td.mysrc1, td.funnelsink11));
......@@ -227,7 +227,7 @@ GST_START_TEST (test_funnel_eos)
fail_unless (gst_pad_push_event (td.mysrc1, gst_event_new_eos ()));
fail_unless (gst_pad_push_event (td.mysrc2, gst_event_new_eos ()));
fail_unless (num_eos == 2);
fail_unless (num_eos == 3);
fail_unless (gst_pad_unlink (td.mysrc1, td.funnelsink11));
gst_element_release_request_pad (td.funnel, td.funnelsink11);
......
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