GNOME Bugzilla – Bug 759110
appsrc: Clear is_eos flag when receiving the flush event
Last modified: 2015-12-21 11:44:14 UTC
Created attachment 316867 [details] Clear is_eos flag when receiving the flush event The EOS event can be propagated to the downstream plugins when is_eos flag remains set even after leaving the flushing state. This fix allows this element to normally restart the streaming after receiving the flush event by clearing the is_eos flag.
Created attachment 316868 [details] [review] appsrc: Clear is_eos flag when receiving the flush event
Review of attachment 316868 [details] [review]: unlock_stop() is not only called for FLUSH_STOP but also for the EOS event... which then completely breaks the is_eos flag. Please use an event handler and handle FLUSH_STOP explicitly there :)
Created attachment 316922 [details] [review] appsrc: Clear is_eos flag when receiving the flush event
Thank you for your review. I've reattached the fixed patch that handles the FLUSH_STOP event. Could you please see it again?
Comment on attachment 316922 [details] [review] appsrc: Clear is_eos flag when receiving the flush event Not in send_event() but in GstBaseSrc::event(). I think you also need to hold the mutex while changing that field.
I agree on the event handling in GstBaseSrc::event(), but I cannot understand why the is_eos clearing should be held with the mutex. Could you tell me what race condition you are concerned about?
None really, just that it's protected by priv->mutex in almost all other places (except in do_seek()). It probably should be protected there too and in event(), mainly because it is used from the streaming thread and other threads (do_seek() is usually called from the application thread).
Created attachment 317611 [details] [review] appsrc: Clear is_eos flag when receiving the flush event
The patch that should be fixed as you requested has been attached. Using GstBaseSrc::event() and the protection with the mutex are included. Could you review it?
commit d43f1b2a5a4361f156ab1281f7e4442a899d4de7 Author: Kazunori Kobayashi <kkobayas@igel.co.jp> Date: Thu Dec 3 11:53:05 2015 +0900 appsrc: Clear is_eos flag when receiving the flush-stop event The EOS event can be propagated to the downstream elements when is_eos flag remains set even after leaving the flushing state. This fix allows this element to normally restart the streaming after receiving the flush event by clearing the is_eos flag. https://bugzilla.gnome.org/show_bug.cgi?id=759110