Bug 224237

Summary: [GStreamer] At EOS, change position to match duration, not the other way around.
Product: WebKit Reporter: Alicia Boya García <aboya>
Component: WebKitGTKAssignee: Alicia Boya García <aboya>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, menard, philipj, pnormand, sergio, vjaquez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Alicia Boya García 2021-04-06 08:12:26 PDT
The criteria used to check if playback has finished is currentTime >=
duration. Currently MediaPlayerPrivateGStreamer::didEnd() ensures this
in an awkward way: by changing the duration so that it matches
currentTime, rather than the other way around.

This meant a duration change at the end of playback most of the time,
with a slightly different duration each time, since currentTime is
cached periodically.

This patch reworks that function to work more naturally and less racy:

First, only if the stream doesn't have a set duration (e.g. live
stream), we set a duration to currentTime, as defined in the spec.

Second, at EOS we update currentTime to match duration, rather than
the other way around.

This patch doesn't introduce changes in test results.
Comment 1 Alicia Boya García 2021-04-06 08:17:19 PDT
Created attachment 425280 [details]
Patch
Comment 2 EWS 2021-04-06 10:10:32 PDT
Committed r275528: <https://commits.webkit.org/r275528>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425280 [details].