New issue
Advanced search Search tips

Issue 592170 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Blink may emit 'ended' for MSE playback without endOfStream() being set

Project Member Reported by sande...@chromium.org, Mar 5 2016

Issue description

HTMLMediaElement emits 'ended' when timeChanged() is called and the current time is >= the media duration. This happens, for example, when seeking to duration.

The implementation is in HTMLMediaElement::timeChanged(), currently https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp&l=2806.

This event should only be emitted when OnPipelineEnded occurs (although currently this path notifies Blink by also via timeChanged()).

This path is how ended events are currently being emitted in media/test/data/mse_different_containers.html browser_tests, such as MSE_ClearKey/EncryptedMediaTest.Playback_EncryptedVideo_MP4_ClearAudio_WEBM/0.
 
(To avoid confusion, the above-mentioned test does set endOfStream(), the critical detail is that this isn't checked in the relevant code path.)

There is a related issue here triggered by the same tests. They have audio and video with different lengths, and when seeking to duration the video track ends but the audio track does not; thus OnPipelineEnded never occurs. This isn't a problem when playing to the end normally, and when seeking it is masked by the timeChanged() event that occurs naturally.

This will need to be fixed at the same time as the primary bug, since it will become visible at that time.
Labels: MSEscrubbed
Thanks for filing. We also have a converse case (bug 530698) where, if endOfStream is marked too soon, and the app changes its mind, if the renderers have already received the "EOS" buffer, the "unmarking" of endOfStream doesn't reach them and playback stalls. Platforms with large depth (that read lots of buffers well in advance of actual current playback time) in the pipeline between demuxerstream and rendering eventually decoded output encounter this converse case more (since it's essentially a race between the EOS read from the demuxer and the app unnmarking EOS before playback actually reaches the original EOS.

Comment 3 by sshru...@google.com, Mar 21 2016

Components: -Blink>Video Blink>Media>Video
Renaming Blink>Video to Blink>Media>Video for better characterization
Owner: chcunningham@chromium.org
Early findings:

While EOS is not explicitly checked in HTMLMediaElement::timeChanged, it does seem that failing to set EOS for MSE streams does actually prevent the ended event from being raised. What happens is the ChunkDemuxer will not perform the seek callback because it finds it is waiting for more data to be appended. 

The related issue (audio and video of different lengths) does seem to check out. I find that OnPipelineEnded does not occur (only of the streams sees its EOS), but the seek callback is still made from ChunkDemuxer (not blocked by waiting for more data), which works its way through WMPI to trigger HTMLMediaElement::timeChanged, ultimately firing the ended event. 

I'm still digging into whether this has any real impact for web developers and what cleanup is right for this.
I found this old bug that makes some recommendations about how to better surface 'ended' - https://bugs.chromium.org/p/chromium/issues/detail?id=409280
Labels: Needs-BlinkMediaTriage
Components: -Blink>Media>Video
Labels: -Needs-BlinkMediaTriage
Project Member

Comment 9 by sheriffbot@chromium.org, Dec 11 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: WontFix (was: Untriaged)
Labels: -Hotlist-Recharge-Cold
Status: Assigned (was: WontFix)
Chris, is this issue fixed?
Probably not, but I'll have to take another look since some things changed in this code path.

Sign in to add a comment