GNOME Bugzilla – Bug 727945
funnel: element doesn't forward eos stream
Last modified: 2014-04-28 06:08:30 UTC
GstFunnel element doesn't forward EOS to downstream, if no data is received before sending eos from multiple source element attached to the funnel. Reproduce with: gst-launch-1.0 -v -e fakesrc num-buffers=0 ! funnel name=f ! fakesink fakesrc num-buffers=0 ! f.
Currently I am working on it.
Created attachment 274125 [details] [review] Handles eos event on sink pad Now it checks if all the sink pad has got eos events then it forwards it to downstream.
Review of attachment 274125 [details] [review]: ::: plugins/elements/gstfunnel.c @@ +159,3 @@ + + if (element->numsinkpads == 0) { + GST_OBJECT_UNLOCK (funnel); Probably makes sense to put all of the unlocks in one place with a goto. @@ +168,3 @@ + /* eos event has not enrolled for current pad, we don't check for current pad */ + if ((pad != NULL) && (pad == sinkpad)) No need to check if the pas is NULL, if it's NULL, pad won't be equal to sinkpad. @@ +265,2 @@ forward = FALSE; + } else if (funnel->last_sinkpad && (pad != funnel->last_sinkpad)) { Same thing here, pad will never be NULL, so no need to check that last_sinkpad is not NULL.
Created attachment 274234 [details] [review] After review comment Fixed all the review comments
Created attachment 274246 [details] [review] After review comment fix Fixed all review comment
Committed a slightly modified version: commit 094fdfee7ec31019a54beb347457435cf9f62a0c Author: Srimanta Panda <srimanta@axis.com> Date: Fri Apr 11 19:52:02 2014 +0200 funnel: Handle end of stream event on sink pad Handle end of stream events on sink pad. Check all the sink pad has received eos before forwarding to source pad. Fixes : https://bugzilla.gnome.org/show_bug.cgi?id=727945
In the 3rd comment Oliver mentioned not to check for NULL. But we need to check for NULL as if both the source pads are sending only EOS without data it will not forward the EOS down stream because the the else if will be executed and funnel->last_sink pad is NULL and forward will FALSE. Please revert the 3rd comments and push it.
Created attachment 275109 [details] [review] Revert the third comment If no data is coming but only EOS is sent from all of the sinkpad, it is not forwarding the EOS. That's why I need to revert the third comment given by Oliver. This secures forwarding the EOS although no dat has received from any of the sink pads.
commit e3e1b0eac769a4d70a705147dcebc8e941af1460 Author: Srimanta Panda <panda_srimanta@yahoo.co.in> Date: Fri Apr 25 07:38:00 2014 +0000 funnel: Check if the last pad was set If no data is coming but only EOS is sent from all of the sinkpad, it is not forwarding the EOS. https://bugzilla.gnome.org/show_bug.cgi?id=727945