Skip to content

Commit 15b9b55

Browse files
committed
[MSE][GStreamer] Early reset m_isEndReached (EOS) when about to seek
When a video has reached End Of Stream and a (backwards) seek is done, the media player won't ever complete the seek because the EOS condition is still in place and no buffers are ever going to be pushed. A successful seek completion would reset the EOS condition, but that won't happen since the seek won't even start. This change resets m_isEndReached as soon as possible (on willSeekToTarget()), so the seek can happen. See: #1568 (comment)
1 parent 39f0dd6 commit 15b9b55

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ void MediaPlayerPrivateGStreamerMSE::pause()
183183
player->playbackStateChanged();
184184
}
185185

186+
void MediaPlayerPrivateGStreamerMSE::willSeekToTarget(const MediaTime& time)
187+
{
188+
MediaPlayerPrivateInterface::willSeekToTarget(time);
189+
// Don't consider the stream as EOS anymore after a seek.
190+
m_isEndReached = false;
191+
}
192+
186193
void MediaPlayerPrivateGStreamerMSE::checkPlayingConsistency()
187194
{
188195
MediaPlayerPrivateGStreamer::checkPlayingConsistency();

Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class MediaPlayerPrivateGStreamerMSE : public MediaPlayerPrivateGStreamer {
5454

5555
void play() override;
5656
void pause() override;
57+
void willSeekToTarget(const MediaTime& time) override;
5758
void seekToTarget(const SeekTarget&) override;
5859
bool doSeek(const SeekTarget&, float rate) override;
5960

0 commit comments

Comments
 (0)