Changeset 246195 in webkit


Ignore:
Timestamp:
Jun 7, 2019 3:54:46 AM (5 years ago)
Author:
eocanha@igalia.com
Message:

[MSE][GStreamer] Avoid QUOTA_EXCEEDED_ERR when seeking to a buffered range just before the buffered one
https://bugs.webkit.org/show_bug.cgi?id=166620

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

This patch is fixing a seek to unbuffered range just before the buffered one.
For example, supposing a [120, 176) append has filled all the memory and then
a seek to 115.0 is done, a subsequent [115, 120) append would fail without
this fix. EvictCodedFrames() would return without actually evicting anything,
and appendBufferInternal will print "buffer full, failing with
QUOTA_EXCEEDED_ERR error" on GStreamer platforms instead of letting the new
[115, 120) append succeed.

This patch is based on an original patch by iivlev <iivlev@productengine.com>

Test: media/media-source/media-source-append-before-last-range-no-quota-exceeded.html

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::evictCodedFrames):
Removed the "only if there are buffered ranges *containing* the currentTime" condition
to enter into the second part of the eviction algorithm, which removes frames
starting from the duration of the media and going backwards down to currentPosition + 30.
The loop break condition has also been changed to deal with notFound currentTimeRange.

LayoutTests:

Added a test to check that, after the memory is filled by appending a continuous
range, a seek right before it and a new append can be done without getting a
QuotaExceededError on GStreamer ports. On the rest of the ports, QuotaExceededError
is never thrown and the expectations just check that the right buffered ranges
remain.

  • media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
  • media/media-source/media-source-append-before-last-range-no-quota-exceeded.html: Added.
  • platform/gtk/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
  • platform/wpe/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246193 r246195  
     12019-06-07  Enrique Ocaña González  <eocanha@igalia.com>
     2
     3        [MSE][GStreamer] Avoid QUOTA_EXCEEDED_ERR when seeking to a buffered range just before the buffered one
     4        https://bugs.webkit.org/show_bug.cgi?id=166620
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Added a test to check that, after the memory is filled by appending a continuous
     9        range, a seek right before it and a new append can be done without getting a
     10        QuotaExceededError on GStreamer ports. On the rest of the ports, QuotaExceededError
     11        is never thrown and the expectations just check that the right buffered ranges
     12        remain.
     13
     14        * media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
     15        * media/media-source/media-source-append-before-last-range-no-quota-exceeded.html: Added.
     16        * platform/gtk/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
     17        * platform/wpe/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Added.
     18
     19
    1202019-06-07  Joonghun Park  <jh718.park@samsung.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r246194 r246195  
     12019-06-07  Enrique Ocaña González  <eocanha@igalia.com>
     2
     3        [MSE][GStreamer] Avoid QUOTA_EXCEEDED_ERR when seeking to a buffered range just before the buffered one
     4        https://bugs.webkit.org/show_bug.cgi?id=166620
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        This patch is fixing a seek to unbuffered range just before the buffered one.
     9        For example, supposing a [120, 176) append has filled all the memory and then
     10        a seek to 115.0 is done, a subsequent [115, 120) append would fail without
     11        this fix. EvictCodedFrames() would return without actually evicting anything,
     12        and appendBufferInternal will print "buffer full, failing with
     13        QUOTA_EXCEEDED_ERR error" on GStreamer platforms instead of letting the new
     14        [115, 120) append succeed.
     15
     16        This patch is based on an original patch by iivlev <iivlev@productengine.com>
     17
     18        Test: media/media-source/media-source-append-before-last-range-no-quota-exceeded.html
     19
     20        * Modules/mediasource/SourceBuffer.cpp:
     21        (WebCore::SourceBuffer::evictCodedFrames):
     22        Removed the "only if there are buffered ranges *containing* the currentTime" condition
     23        to enter into the second part of the eviction algorithm, which removes frames
     24        starting from the duration of the media and going backwards down to currentPosition + 30.
     25        The loop break condition has also been changed to deal with notFound currentTimeRange.
     26
    1272019-06-07  Philippe Normand  <philn@igalia.com>
    228
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r243887 r246195  
    992992    auto buffered = m_buffered->ranges();
    993993    size_t currentTimeRange = buffered.find(currentTime);
    994     if (currentTimeRange == notFound || currentTimeRange == buffered.length() - 1) {
     994    if (currentTimeRange == buffered.length() - 1) {
    995995#if !RELEASE_LOG_DISABLED
    996996        ERROR_LOG(LOGIDENTIFIER, "FAILED to free enough after evicting ", initialBufferedSize - extraMemoryCost());
     
    10071007        // Do not evict data from the time range that contains currentTime.
    10081008        size_t startTimeRange = buffered.find(rangeStart);
    1009         if (startTimeRange == currentTimeRange) {
     1009        if (currentTimeRange != notFound && startTimeRange == currentTimeRange) {
    10101010            size_t endTimeRange = buffered.find(rangeEnd);
    1011             if (endTimeRange == currentTimeRange)
     1011            if (currentTimeRange != notFound && endTimeRange == currentTimeRange)
    10121012                break;
    10131013
Note: See TracChangeset for help on using the changeset viewer.