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
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.
Created attachment 425280 [details]
Committed r275528: <https://commits.webkit.org/r275528>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 425280 [details].