-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GStreamer][MSE] Take playbin's states lock when sending seek event #29897
Conversation
EWS run on previous version of this PR (hash 29c0e21) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
gst_element_seek(m_source.get(), rate, GST_FORMAT_TIME, m_seekFlags, | ||
GST_SEEK_TYPE_SET, toGstClockTime(target.time), GST_SEEK_TYPE_NONE, 0); | ||
{ | ||
auto locker = GstStateLocker(pipeline()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs an explanation. For instance:
// Take the STATE_LOCK of the __pipeline__.
//
// gst_element_send_event() [which is called by gst_element_seek()] already takes the
// STATE_LOCK of the element in order to delay any state change attempts from other
// threads while the event is travelling the pipeline.
//
// Normally that would happen to both the pipeline and then recursively to the
// elements inside as they handle the seek event, but since we're sending the event
// directly to the source element we need to take the STATE_LOCK on the pipeline ourselves.
EWS run on current version of this PR (hash a5b17e9) |
https://bugs.webkit.org/show_bug.cgi?id=275566 Reviewed by Alicia Boya Garcia. This fixes possible race between application (triggering another seek from 'seeked' event) and 'state chagne' continuation (triggered by playbin). Top level bin element does change the state as result of 'async-done' handling from previous seek request (see gst_bin_continue_func in gstbin.c). Which may race with handling of 'async-start' posted by sinks on flushing seek. And may leave the pipeline in inconsistent state and 'hanging' seek that never finishes. By taking the states lock of top level bin element player will wait for possible state change continuation to complete before sending next seek event. Based on a patch by Eugene Mutavchi <[email protected]>. * Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Canonical link: https://commits.webkit.org/280168@main
a5b17e9
to
81376ca
Compare
Committed 280168@main (81376ca): https://commits.webkit.org/280168@main Reviewed commits have been landed. Closing PR #29897 and removing active labels. |
81376ca
a5b17e9
π§ͺ api-ios