[MSE] Prevent SourceBuffer monitoring algorithm from triggering a HAVE_NOTHING to...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Dec 2014 17:29:14 +0000 (17:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Dec 2014 17:29:14 +0000 (17:29 +0000)
commit585c0e805353c2862a9be50e35ce3c004a8eb572
tree8bb236bccc4fc9d542a713ed6b6d9e65d418e1cc
parent7406ae3bacc6654e35e63a399754cb8fd9546402
[MSE] Prevent SourceBuffer monitoring algorithm from triggering a HAVE_NOTHING to HAVE_METADATA transition.
https://bugs.webkit.org/show_bug.cgi?id=139444

Patch by Bartlomiej Gajda <b.gajda@samsung.com> on 2014-12-15
Reviewed by Jer Noble.

Source/WebCore:

In case of 2 SourceBuffers, there can be transition to HaveMetadata from monitorSourceBuffers,
even though second SourceBuffer did not receive init segment - we can't query for it's metadata
such as width/height (if second one was video), so we shouldn't fire the event.
W3 Bug reference : https://www.w3.org/Bugs/Public/show_bug.cgi?id=27542

Test: media/media-source/media-source-loadedmetada-with-two-sourcebuffers.html

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::monitorSourceBuffers):
* Modules/mediasource/SourceBuffer.h:
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::mimeTypeCache):

LayoutTests:

Added test to check how many active SourceBuffers exist when loadedmetadata fires,
according to spec 3.5.7, this should be equal to number of sourcebuffers.

* media/media-source/media-source-loadedmetada-with-two-sourcebuffers-expected.txt: Added.
* media/media-source/media-source-loadedmetada-with-two-sourcebuffers.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-loadedmetada-with-two-sourcebuffers-expected.txt [new file with mode: 0644]
LayoutTests/media/media-source/media-source-loadedmetada-with-two-sourcebuffers.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp