Skip to content

Commit

Permalink
[GStreamer] Ignore early EOS only when not looping
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264398

Reviewed by Philippe Normand.

When playing video in a loop using HTML5 video element, the Gstreamer
debug log sometimes contains the following message, which prevents the
WPE from correctly stopping the playback before restarting it for the
next loop and the playback ends up paused forever:

```
webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1851:handleMessage:<video-1> EOS received but position {23823333333/1000000000 = 23.823333333} is still in the finite playable limits [{0/1 = 0}, {23828333333/1000000000 = 23.828333333}], ignoring it
```

Ignore early EOS only when not looping, otherwise unconditionally
indicate the stream has ended.

* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):

Canonical link: https://commits.webkit.org/270593@main
  • Loading branch information
Marek Vasut authored and philn committed Nov 11, 2023
1 parent aabc9b4 commit 76bc3f4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)

if (GST_CLOCK_TIME_IS_VALID(gstreamerPosition))
playbackPosition = MediaTime(gstreamerPosition, GST_SECOND);
if (!eosFlagIsSetInSink && playbackPosition.isValid() && duration.isValid()
if (!player->isLooping() && !eosFlagIsSetInSink && playbackPosition.isValid() && duration.isValid()
&& ((m_playbackRate >= 0 && playbackPosition < duration && duration.isFinite())
|| (m_playbackRate < 0 && playbackPosition > MediaTime::zeroTime()))) {
GST_DEBUG_OBJECT(pipeline(), "EOS received but position %s is still in the finite playable limits [%s, %s], ignoring it",
Expand Down

0 comments on commit 76bc3f4

Please sign in to comment.