Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 2440563004: Switch to using an explicit ended signal instead of time comparison. (Closed)

Created:
4 years, 2 months ago by DaleCurtis
Modified:
3 years, 10 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, mlamouri+watch-blink_chromium.org, posciak+watch_chromium.org, nessy, Srirama, vcarbune.chromium
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch to using an explicit ended signal instead of time comparison. Time comparison is fragile in a world of poorly muxed media, so instead rely on an explicit ended signal. This also includes a fix so that the duration is updated correctly in circumstances of poorly muxed media. BUG=409280, 645998 TEST=video plays; duration increases.

Patch Set 1 : Bloop. #

Patch Set 2 : Fix tests. #

Total comments: 2

Patch Set 3 : Fix ended event in ARI. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -43 lines) Patch
M content/renderer/media/android/webmediaplayer_android.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_cast_android.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M media/blink/webmediaplayer_impl.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/filters/ffmpeg_demuxer.h View 1 chunk +1 line, -0 lines 0 comments Download
M media/filters/ffmpeg_demuxer.cc View 1 2 4 chunks +30 lines, -16 lines 0 comments Download
M media/filters/ffmpeg_demuxer_unittest.cc View 1 2 6 chunks +8 lines, -6 lines 0 comments Download
M media/renderers/audio_renderer_impl.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M media/test/pipeline_integration_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/test/pipeline_integration_test_base.cc View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.cpp View 2 chunks +2 lines, -9 lines 2 comments Download
M third_party/WebKit/public/platform/WebMediaPlayerClient.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 29 (19 generated)
DaleCurtis
WDYT? The spec talks about time comparisons, but that's kludgy (floating point math, bad muxing, ...
4 years, 2 months ago (2016-10-20 21:44:36 UTC) #6
mlamouri (slow - plz ping)
I do not have that much background here but instead of increasing the duration while ...
4 years, 2 months ago (2016-10-21 10:43:38 UTC) #15
DaleCurtis
Unknown duration has implications for seekability IIRC, which is why I didn't take that approach. ...
4 years, 2 months ago (2016-10-21 17:17:05 UTC) #16
DaleCurtis
On 2016/10/21 at 17:17:05, DaleCurtis wrote: > Unknown duration has implications for seekability IIRC, which ...
4 years, 2 months ago (2016-10-21 22:59:18 UTC) #17
DaleCurtis
+chcunningham since this has a fair bit of media/ code and he was interested in ...
4 years, 2 months ago (2016-10-21 23:39:40 UTC) #21
mlamouri (slow - plz ping)
Thanks for looking into the alternative. lgtm
4 years, 2 months ago (2016-10-24 10:42:59 UTC) #24
chcunningham
https://codereview.chromium.org/2440563004/diff/60001/media/filters/ffmpeg_demuxer.cc File media/filters/ffmpeg_demuxer.cc (right): https://codereview.chromium.org/2440563004/diff/60001/media/filters/ffmpeg_demuxer.cc#newcode1688 media/filters/ffmpeg_demuxer.cc:1688: duration_known_ ? stream->duration() : stream->GetElapsedTime(); why not always pick ...
4 years, 1 month ago (2016-10-24 20:18:54 UTC) #25
chcunningham
Also, take a look at this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=592170 I think this change completely addresses that
4 years, 1 month ago (2016-10-24 20:28:02 UTC) #26
chcunningham
https://codereview.chromium.org/2440563004/diff/80001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right): https://codereview.chromium.org/2440563004/diff/80001/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp#newcode3194 third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:3194: return dur > 0 && now >= dur && ...
4 years, 1 month ago (2016-10-24 22:48:41 UTC) #28
DaleCurtis
4 years, 1 month ago (2016-10-24 23:29:44 UTC) #29
It's also further complicated by all these failing bots... which are due to
inaccurate duration information in the muxed files and ffmpeg bugs.

E.g., the test.ogv used by many layout tests has a audio stream which continues
past the end of the video track, but metadata duration only includes the video
track.

E.g., the test.webm file sums to a duration of 1.0009999 while the written
duration is 1.001 :/

https://codereview.chromium.org/2440563004/diff/80001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/html/HTMLMediaElement.cpp (right):

https://codereview.chromium.org/2440563004/diff/80001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/html/HTMLMediaElement.cpp:3194: return dur > 0 &&
now >= dur &&
On 2016/10/24 at 22:48:41, chcunningham wrote:
> currentTime is still being compared to duration here. would it be more correct
to use ended_ = true/false, saved from last call to timeChanged (or perhaps made
public accesssor from WMPI interface)?

Ah, good find. This is becoming problematic since it'll now start causing less
surgical deviations from the HTML5 video algorithm as proposed by the spec...

Powered by Google App Engine
This is Rietveld 408576698