Skip to content

Commit

Permalink
MSE: Fix mediasource-changetype-play to work with MseBufferByPts
Browse files Browse the repository at this point in the history
This web-platform-test exercises changeType as it splice-overlaps
pairs of audio or video media streams at varying offsets in the
presentation timeline. Splice-overlapping an out-of-order decode stream
(such as the test AVC MP4 media) at arbitrary times can, per spec, drop
significant decode dependencies from a partially-overlapped GOP such
that a buffered range gap could result.

This change is more careful about where it performs splice-overlaps when
the overlapped media is out-of-order-decode, adjusting the splice point
to be at or very near to the next overlapped keyframe. This prevents
removing out-of-order non-keyframes and their dependents from the
overlapped media such that no buffered range gap nor playback stall
should result.

Note that Chromium is sensitive to such out-of-order buffering overlaps
with the new, compliant, MseBufferByPts behavior. Fixing
w3c/media-source#160 could greatly simplify
this problem by allowing apps to explicitly control how the
user agent behaves at these small gaps.

BUG=807793

Change-Id: I020e244c230756eaa1804f81b58a577124a6a28b
  • Loading branch information
wolenetz authored and chromium-wpt-export-bot committed Mar 22, 2019
1 parent 023f875 commit 31da275
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 156 deletions.
33 changes: 16 additions & 17 deletions media-source/mediasource-changetype-play.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@
<div id="log"></div>
<script>

function generateChangeTypeTests(audio_types, video_types)
{
async_test(function(test) {
assert_true(audio_types.length > 1, "Browser doesn't support at least 2 types of audio test media" + audio_types);
assert_true(video_types.length > 1, "Browser doesn't support at least 2 types of video test media");
test.done();
}, "Check if browser supports enough test media types");
function generateChangeTypeTests(audio_types, video_types) {
async_test((test) => {
assert_true(audio_types.length > 1, "Browser doesn't support at least 2 types of audio test media");
assert_true(video_types.length > 1, "Browser doesn't support at least 2 types of video test media");
test.done();
}, "Check if browser supports enough test media types");

// Generate audio-only changeType tests
for (let audio1 of audio_types) {
for (let audio2 of audio_types) {
mediaSourceChangeTypeTest(audio1, audio2, "Test audio-only changeType for " + audio1.type + " <-> " + audio2.type);
}
// Generate audio-only changeType tests
for (let audio1 of audio_types) {
for (let audio2 of audio_types) {
mediaSourceChangeTypeTest(audio1, audio2, "Test audio-only changeType for " + audio1.type + " <-> " + audio2.type);
}
}

// Generate video-only changeType tests
for (let video1 of video_types) {
for (let video2 of video_types) {
mediaSourceChangeTypeTest(video1, video2, "Test video-only changeType for " + video1.type + " <-> " + video2.type);
}
// Generate video-only changeType tests
for (let video1 of video_types) {
for (let video2 of video_types) {
mediaSourceChangeTypeTest(video1, video2, "Test video-only changeType for " + video1.type + " <-> " + video2.type);
}
}
}

findSupportedChangeTypeTestTypes(generateChangeTypeTests);
Expand Down
Loading

0 comments on commit 31da275

Please sign in to comment.