GNOME Bugzilla – Bug 734058
basesrc: pad task started before start_complete when seeking
Last modified: 2018-11-03 12:21:57 UTC
Created attachment 282178 [details] Simple test case To reproduce this you need to: * create a basesrc based source element * gst_base_src_set_async(src, TRUE) * gst_element_set_state(src, GST_STATE_PLAYING) * send a seek event at the pad The task is now started without having called gst_base_src_start_complete. This means resource allocation in the start callback may not be complete. It isn't clear what the plugin could do to handle this other than return failure from the fill function (or similar). Blocking in the fill function at this point leads to deadlocks. Looking around gstbasesrc.c it appears there are other ways to trigger this issue. I suspect that some checks for GST_BASE_SRC_IS_STARTED are required with appropriate locking. A test case is attached - it shouldn't assert.
You test is incorrect though. You should send the seek event to your pipeline, or the src element, not directly to the pad. Receiving a seek on a pad before the start has completed is unexpected. The bug remains of course, but the fix won't work with by-passing the Bin/Element hierarchy.
Created attachment 354892 [details] Test sending event to the element This test sends the event to the element, properly doing a seek on ready. Still display the issue, fix coming.
Created attachment 354893 [details] [review] basesrc: Queue pending seeks if not started yet When async start is enables, we should queue pending seeks to avoid early start of the streaming thread.
That being said, Maybe receiving a seek the initial tested way exist, I'd change the test to use a pipeline and send the seek to the pipeline to see what happens. It's not clear if the seek will fail or cause the same issue.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/70.