Changeset 247783 in webkit


Ignore:
Timestamp:
Jul 24, 2019 11:13:05 AM (5 years ago)
Author:
aboya@igalia.com
Message:

[MSE] Reenqueue after removeCodedFrames()
https://bugs.webkit.org/show_bug.cgi?id=199749

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Before this patch, SourceBuffer::removeCodedFrames() did not trigger
an immediate reenqueue, but rather just set the needsReenqueuing
flag, deferring it for the next append... but there may not be another
append! In that case, the removed frames would still wrongly play.

This is the case for instance in tests where a single long media
append is done and then "cropped" with SourceBuffer.erase().

Test: media/media-source/media-source-erase-after-last-append.html

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::removeCodedFrames):

LayoutTests:

Added a test that checks that when an .erase() is performed after the
last append the erased frames are indeed not played.

  • media/media-source/media-source-erase-after-last-append-expected.txt: Added.
  • media/media-source/media-source-erase-after-last-append.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247768 r247783  
     12019-07-24  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE] Reenqueue after removeCodedFrames()
     4        https://bugs.webkit.org/show_bug.cgi?id=199749
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Added a test that checks that when an .erase() is performed after the
     9        last append the erased frames are indeed not played.
     10
     11        * media/media-source/media-source-erase-after-last-append-expected.txt: Added.
     12        * media/media-source/media-source-erase-after-last-append.html: Added.
     13
    1142019-07-24  Russell Epstein  <repstein@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r247779 r247783  
     12019-07-24  Alicia Boya García  <aboya@igalia.com>
     2
     3        [MSE] Reenqueue after removeCodedFrames()
     4        https://bugs.webkit.org/show_bug.cgi?id=199749
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Before this patch, SourceBuffer::removeCodedFrames() did not trigger
     9        an immediate reenqueue, but rather just set the `needsReenqueuing`
     10        flag, deferring it for the next append... but there may not be another
     11        append! In that case, the removed frames would still wrongly play.
     12
     13        This is the case for instance in tests where a single long media
     14        append is done and then "cropped" with SourceBuffer.erase().
     15
     16        Test: media/media-source/media-source-erase-after-last-append.html
     17
     18        * Modules/mediasource/SourceBuffer.cpp:
     19        (WebCore::SourceBuffer::removeCodedFrames):
     20
    1212019-07-24  Jer Noble  <jer.noble@apple.com>
    222
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r247133 r247783  
    833833    // 2. Let end be the end presentation timestamp for the removal range.
    834834    // 3. For each track buffer in this source buffer, run the following steps:
    835     for (auto& trackBuffer : m_trackBufferMap.values()) {
     835    for (auto& trackBufferKeyValue : m_trackBufferMap) {
     836        TrackBuffer& trackBuffer = trackBufferKeyValue.value;
     837        AtomString trackID = trackBufferKeyValue.key;
     838
    836839        // 3.1. Let remove end timestamp be the current value of duration
    837840        // 3.2 If this track buffer has a random access point timestamp that is greater than or equal to end, then update
     
    885888            PlatformTimeRanges possiblyEnqueuedRanges(currentMediaTime, trackBuffer.lastEnqueuedPresentationTime);
    886889            possiblyEnqueuedRanges.intersectWith(erasedRanges);
    887             if (possiblyEnqueuedRanges.length())
     890            if (possiblyEnqueuedRanges.length()) {
    888891                trackBuffer.needsReenqueueing = true;
     892                DEBUG_LOG(LOGIDENTIFIER, "the range in removeCodedFrames() includes already enqueued samples, reenqueueing from ", currentMediaTime);
     893                reenqueueMediaForTime(trackBuffer, trackID, currentMediaTime);
     894            }
    889895        }
    890896
Note: See TracChangeset for help on using the changeset viewer.