From 31da2753b751a2cde94145b195f97644ffd64ed9 Mon Sep 17 00:00:00 2001 From: Matt Wolenetz Date: Thu, 21 Mar 2019 17:29:37 -0700 Subject: [PATCH] MSE: Fix mediasource-changetype-play to work with MseBufferByPts 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 https://github.com/w3c/media-source/issues/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 --- media-source/mediasource-changetype-play.html | 33 +- media-source/mediasource-changetype-util.js | 340 +++++++++++------- 2 files changed, 217 insertions(+), 156 deletions(-) diff --git a/media-source/mediasource-changetype-play.html b/media-source/mediasource-changetype-play.html index c4527149d0d4b8..ae6bd9b1b901ff 100644 --- a/media-source/mediasource-changetype-play.html +++ b/media-source/mediasource-changetype-play.html @@ -12,27 +12,26 @@