Commit 4addea8
committed
[MSE][GStreamer] Early reset m_isEndReached (EOS) when about to seek
https://bugs.webkit.org/show_bug.cgi?id=302160
Reviewed by NOBODY (OOPS!).
This specific issue related to seek after EOS was seen downstream:
1. EOS is reached: m_isEndReached becomes true. HTMLMediaElement marks
itself as paused. It also transitions to HaveCurrentData as a result
of the EOS, which pauses the GStreamer pipeline.
2. Seek from JS occurs: A seek in HTMLMediaElement coming from the DOM
does the following:
2.1. Synchronously sets m_lastSeekTime (which is read by
MediaSource::currentTime()).
2.2. Synchronously calls MediaPlayerPrivate::willSeekToTarget().
2.3. Schedules an asynchronous call to
MediaPlayerPrivate::seekToTarget() which hasn't happened yet.
3. monitorSourceBuffers() notices the new currentTime (i.e. the seek
target time) is in the buffered ranges and therefore upgrades ready
state to HaveEnoughData:
The GStreamer player reacts and the pipeline is now set to PLAYING,
but critically, because m_isEndReached hasn't been reset yet,
paused() returns still true.
From now on until the completion of the seek we are in an invalid
state where the multiplatform code will (reasonably) assume its
request to play has been honored and that the if our player is
paused, that has been intentionally done for some platform specific
reason, which it will try to synchronize to, preventing playback from
resuming.
Clearing m_isEndReached synchronously fixes the race.
This change resets m_isEndReached as soon as possible (on
willSeekToTarget()), so the seek can happen.
See: WebPlatformForEmbedded/WPEWebKit#1568 (comment)
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::willSeekToTarget): Reset m_isEndReached as soon as we know that a seek will happen.
* Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: Override willSeekToTarget().1 parent bd08842 commit 4addea8
File tree
2 files changed
+8
-0
lines changed- Source/WebCore/platform/graphics/gstreamer/mse
2 files changed
+8
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
0 commit comments