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.
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.
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 on attachment 243290 [details] patch v2 return when have_nothing Clearing flags on attachment: 243290 Committed r177281: <http://trac.webkit.org/changeset/177281>
All reviewed patches have been landed. Closing bug.