Bug 139444

Summary: [MSE] Prevent SourceBuffer monitoring algorithm from triggering a HAVE_NOTHING to HAVE_METADATA transition.
Product: WebKit Reporter: Bartlomiej Gajda <b.gajda>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, commit-queue, eric.carlson, glenn, jer.noble, ltilve, philipj, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
exit monitorSourceBuffers if any SB didn't receive init segment yet
none
patch v2 return when have_nothing none

Description Bartlomiej Gajda 2014-12-09 05:23:19 PST
Currently transition to HaveMetadata is both in sourceBufferPrivateDidReceiveInitializationSegment() and monitorSourceBuffers();

As monitorSourcebuffers is called after each every append, in 2 SourceBuffers scenario (audio+video) it means, that we send `loadedmetadata` event before second SB will get his first init segment.

But `loadedmetadata` states (http://www.w3.org/TR/html5/embedded-content-0.html#event-media-loadedmetadata)
"The user agent has just determined the duration and dimensions of the media resource and the text tracks are ready. "

So in scenario with first append going to audio SB, second to video SB, we will be unable to ask for video dimension in `loadedmetadata` event handler, as there was no init segment yet.

I believe we shouldn't fire this event untill every SourceBuffer have first init segment.

Made a bug against spec: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27542 
with few more words in it.
Comment 1 Bartlomiej Gajda 2014-12-09 05:28:43 PST
Created attachment 242911 [details]
exit monitorSourceBuffers if any SB didn't receive init segment yet

LayoutTest simulates written scenario with ActiveSourceBuffers, as there is no width/height in MockMSE yet, and occurrence is the same for both cases.
Comment 2 Bartlomiej Gajda 2014-12-15 05:17:46 PST
Created attachment 243290 [details]
patch v2  return when have_nothing

Shamelessly stolen name from what it looks like in Editor's Draft changelog.

As bug in spec was resolved in a way that fixes this issue, I have prepared second version which complies new spec.
Comment 3 WebKit Commit Bot 2014-12-15 09:28:36 PST
Comment on attachment 243290 [details]
patch v2  return when have_nothing

Clearing flags on attachment: 243290

Committed r177281: <http://trac.webkit.org/changeset/177281>
Comment 4 WebKit Commit Bot 2014-12-15 09:28:40 PST
All reviewed patches have been landed.  Closing bug.