GNOME Bugzilla – Bug 732851
funnel: storing sticky events after event callback
Last modified: 2014-07-22 12:32:11 UTC
When EOS events comes simultaneously from two sinkpads, it doesn't forward the eos to source pad, although both sinkpads have got the eos. Reason: Sticky events are stored after the event callbacks are returned. Suppose one sinkpad has returned from event callback and not stored the sticky event yet, but by that time event callback for other sink pad is called and checked for all sinkpads eos. And it assumes first sinkpad has not received EOS. So the second sinkpad doesnot forward the EOS to sourcepad.
I am working on a patch for this issue currently.
Created attachment 280629 [details] [review] Fix racy funnel eos handling
Review of attachment 280629 [details] [review]: Looks good, just one minor change needed. Thanks for the patch! ::: plugins/elements/gstfunnel.c @@ +313,3 @@ + GST_PAD_STREAM_LOCK (funnel->srcpad); + GST_OBJECT_UNLOCK (funnel); + fpad->got_eos = FALSE; You also need to reset got_eos when the pad is deactivated, i.e. when the element goes from PAUSED to READY state.
Created attachment 280690 [details] [review] After review comment fix
Review of attachment 280690 [details] [review]: ::: plugins/elements/gstfunnel.c @@ +302,2 @@ if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { + GST_OBJECT_UNLOCK (funnel); This should probably be GST_OBJECT_LOCK @@ +315,3 @@ + unlock = TRUE; + GST_PAD_STREAM_LOCK (funnel->srcpad); + GST_OBJECT_UNLOCK (funnel); And this too... and why do you take the stream lock here? That seems wrong, you already have it here (and never release it anyway)
The second one is correct because while pushing the FLUSH event we are locking the srcpad ( same as the EOS event) and based on variable 'unlock' we are unlocking the stream. The first comment i will correct it and push it again.
Ok, but the object lock there is still wrong.
yes, that I am correcting.
Created attachment 280869 [details] [review] Fix racy funnel eos handling
commit 6d05df01b0e2865eab3a53c9feef49d3f110dde1 Author: Srimanta Panda <srimanta@axis.com> Date: Wed Jul 9 15:48:10 2014 +0200 funnel: Fix for racy EOS event handling When eos events are forwarded simultaneouly from two sinkpads on funnel, it doesnot forward the eos to sourcepad. The reason is sticky events are stored after the event callbacks are returned. Therefore while one is about to store the sticky events on the its sinkpad, other sinkpad starts checking for the eos events on all other sinkpads and assumes eos is not present yet. https://bugzilla.gnome.org/show_bug.cgi?id=732851