Bug 135291

Summary: [MSE] YouTube playback stalls & readyState drops to HAVE_CURRENT_DATA at end of stream with unbalanced buffered SourceBuffers
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, calvaris, commit-queue, eric.carlson, glenn, jonlee, ltilve, philipj, rniwa, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2
none
Patch sam: review+

Description Jer Noble 2014-07-25 09:04:13 PDT
[MSE] Playback stalls & readyState drops to HAVE_CURRENT_DATA at end of stream with unbalanced buffered SourceBuffers
Comment 1 Jon Lee 2014-07-25 10:17:12 PDT
<rdar://problem/17715503>
Comment 2 Jer Noble 2014-07-25 10:55:52 PDT
Created attachment 235525 [details]
Patch
Comment 3 Jon Lee 2014-07-25 11:42:11 PDT
Comment on attachment 235525 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235525&action=review

> Source/WebCore/Modules/mediasource/SourceBuffer.cpp:1462
> +        MediaTime start = length ? virtualRanges->end(length - 1) : MediaTime::zeroTime();

Is the added check necessary since an invalid index will return zeroTime() anyway?
Comment 4 Build Bot 2014-07-25 11:58:34 PDT
Comment on attachment 235525 [details]
Patch

Attachment 235525 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5917561690521600

New failing tests:
media/track/add-and-remove-track.html
Comment 5 Build Bot 2014-07-25 11:58:37 PDT
Created attachment 235535 [details]
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-09  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 6 Jer Noble 2014-07-25 13:26:03 PDT
Created attachment 235539 [details]
Patch
Comment 7 Sam Weinig 2014-07-25 14:39:43 PDT
Comment on attachment 235539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235539&action=review

> Source/WebCore/ChangeLog:3
> +        [MSE] Playback stalls & readyState drops to HAVE_CURRENT_DATA at end of stream with unbalanced buffered SourceBuffers

Please add the radar for future Sam's sake and also change the title to explain why this is important (aka Youtube is broken).

> Source/WebCore/platform/graphics/PlatformTimeRanges.h:54
>  
> +    MediaTime start(unsigned index) const;
>      MediaTime start(unsigned index, bool& valid) const;
> +    MediaTime end(unsigned index) const;
>      MediaTime end(unsigned index, bool& valid) const;
> +    MediaTime duration(unsigned index) const;
> +    MediaTime maximumBufferedTime() const;

You don't have to do this now, but you should eventually switch these to return Optional<MediaTime> if they can fail.
Comment 8 Jer Noble 2014-07-25 14:48:40 PDT
Comment on attachment 235539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235539&action=review

>> Source/WebCore/ChangeLog:3
>> +        [MSE] Playback stalls & readyState drops to HAVE_CURRENT_DATA at end of stream with unbalanced buffered SourceBuffers
> 
> Please add the radar for future Sam's sake and also change the title to explain why this is important (aka Youtube is broken).

Will do.

>> Source/WebCore/platform/graphics/PlatformTimeRanges.h:54
>> +    MediaTime maximumBufferedTime() const;
> 
> You don't have to do this now, but you should eventually switch these to return Optional<MediaTime> if they can fail.

Neat, I learned something new today.
Comment 9 Jer Noble 2014-07-25 15:39:26 PDT
Committed r171624: <http://trac.webkit.org/changeset/171624>