Skip to content

Commit

Permalink
Cherry-pick 270593@main (76bc3f4). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=264398

    [GStreamer] Ignore early EOS only when not looping
    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 aperezdc committed Jan 26, 2024
1 parent 60a14f2 commit eb16a51
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,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 eb16a51

Please sign in to comment.