Changeset 270106 in webkit
- Timestamp:
- Nov 20, 2020 4:19:20 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270103 r270106 1 2020-11-20 Philippe Normand <pnormand@igalia.com> 2 3 [MSE] Infinite loop in sample eviction when duration is NaN 4 https://bugs.webkit.org/show_bug.cgi?id=218228 5 6 Reviewed by Darin Adler. 7 8 * media/media-source/live-rewind-seek-and-evict-expected.txt: Renamed from LayoutTests/platform/glib/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt. 9 * media/media-source/live-rewind-seek-and-evict.html: Added. 10 * media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: 11 * media/media-source/mock-media-source.js: 12 (makeAInit): 13 * platform/mac/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt: Copied from LayoutTests/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt. 14 1 15 2020-11-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 16 -
trunk/LayoutTests/media/media-source/live-rewind-seek-and-evict-expected.txt
r270103 r270106 1 1 This tests rewind seeks in a live stream. The sample eviction algorithm should attempt to remove some samples without going into an infinite loop. 2 2 EVENT(sourceopen) 3 3 EVENT(updateend) 4 EXPECTED ( video.currentTime == '120') OK4 EXPECTED (isNaN(source.duration) == 'true') OK 5 5 Appending PTS=120 6 6 EVENT(updateend) … … 116 116 EVENT(updateend) 117 117 Appending PTS=176 118 EXPECTED (exception == 'QuotaExceededError: The quota has been exceeded.') OK 119 EXPECTED (bufferedRanges() == '[ 120...176 ]') OK 118 EVENT(updateend) 119 EXPECTED (video.currentTime == '175') OK 120 EXPECTED (bufferedRanges() == '[ 120...132, 162...177 ]') OK 120 121 EXPECTED (video.currentTime == '115') OK 122 Appending PTS=109 123 EVENT(updateend) 124 Appending PTS=110 125 EVENT(updateend) 126 Appending PTS=111 127 EVENT(updateend) 128 Appending PTS=112 129 EVENT(updateend) 130 Appending PTS=113 131 EVENT(updateend) 132 Appending PTS=114 133 EVENT(updateend) 121 134 Appending PTS=115 122 135 EVENT(updateend) … … 127 140 Appending PTS=118 128 141 EVENT(updateend) 129 EXPECTED (exception != 'QuotaExceededError: The quota has been exceeded.') OK 130 EXPECTED (bufferedRanges() == '[ 115...119, 120...170 ]') OK 142 Appending PTS=119 143 EVENT(updateend) 144 EXPECTED (bufferedRanges() == '[ 109...132, 162...177 ]') OK 131 145 END OF TEST 132 146 -
trunk/LayoutTests/media/media-source/media-source-append-before-last-range-no-quota-exceeded-expected.txt
r246195 r270106 116 116 EVENT(updateend) 117 117 Appending PTS=176 118 EVENT(updateend) 119 EXPECTED (exception == 'QuotaExceededError: The quota has been exceeded.'), OBSERVED 'null' FAIL 120 EXPECTED (bufferedRanges() == '[ 120...176 ]'), OBSERVED '[ 120...177 ]' FAIL 118 EXPECTED (exception == 'QuotaExceededError: The quota has been exceeded.') OK 119 EXPECTED (bufferedRanges() == '[ 120...176 ]') OK 121 120 EXPECTED (video.currentTime == '115') OK 122 121 Appending PTS=115 -
trunk/LayoutTests/media/media-source/mock-media-source.js
r237651 r270106 76 76 array.set(stringToArray('init')); 77 77 78 var view = new DataView(buffer); 79 var timeScale = 1000; 80 view.setUint32(4, byteLength, true); 81 view.setInt32(8, duration * timeScale, true); 82 view.setInt32(12, timeScale, true); 78 if (!isNaN(duration)) { 79 var view = new DataView(buffer); 80 var timeScale = 1000; 81 view.setUint32(4, byteLength, true); 82 view.setInt32(8, duration * timeScale, true); 83 view.setInt32(12, timeScale, true); 84 } 83 85 84 86 var offset = 16; -
trunk/Source/WTF/ChangeLog
r270067 r270106 1 2020-11-20 Philippe Normand <pnormand@igalia.com> 2 3 [MSE] Infinite loop in sample eviction when duration is NaN 4 https://bugs.webkit.org/show_bug.cgi?id=218228 5 6 Reviewed by Darin Adler. 7 8 * wtf/MediaTime.h: New isFinite() method, to check if the MediaTime is valid and represents 9 a finite value, eg not NaN or Infinite. 10 1 11 2020-11-19 Ada Chan <adachan@apple.com> 2 12 -
trunk/Source/WTF/wtf/MediaTime.h
r259917 r270106 97 97 bool isNegativeInfinite() const { return m_timeFlags & NegativeInfinite; } 98 98 bool isIndefinite() const { return m_timeFlags & Indefinite; } 99 bool isFinite() const { return !isInvalid() && !isIndefinite() && !isPositiveInfinite() && !isNegativeInfinite(); } 99 100 bool hasDoubleValue() const { return m_timeFlags & DoubleValue; } 100 101 uint8_t timeFlags() const { return m_timeFlags; } -
trunk/Source/WebCore/ChangeLog
r270103 r270106 1 2020-11-20 Philippe Normand <pnormand@igalia.com> 2 3 [MSE] Infinite loop in sample eviction when duration is NaN 4 https://bugs.webkit.org/show_bug.cgi?id=218228 5 6 Reviewed by Darin Adler. 7 8 Avoid infinite loop in evictCodedFrames for live streams 9 10 When playing live streams the MediaSource DOM duration attribute has no meaning 11 and would thus be set as +inf. When seeks are triggered to positions prior to 12 the current playback position the SourceBuffer might attempt to free some space 13 in order to keep the amount of memory used under control. It proceeds in 2 14 steps: 15 16 1. Attempt to free space represented by buffered range from media start up until 17 current playback position - 30 seconds. 18 2. If step 1 didn't free enough memory, attempt to release memory represented by 19 buffered ranges starting from current playback position + 30 seconds until media 20 duration. 21 22 Step 2 here wasn't taking into account the case where MediaSource.duration is 23 actually invalid, and thus was entering an infinite loop. 24 25 Test: media/media-source/live-rewind-seek-and-evict.html 26 27 * Modules/mediasource/SourceBuffer.cpp: 28 (WebCore::SourceBuffer::evictCodedFrames): 29 1 30 2020-11-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 31 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r269907 r270106 997 997 998 998 rangeEnd = m_source->duration(); 999 if (!rangeEnd.isFinite()) { 1000 rangeEnd = buffered.maximumBufferedTime(); 1001 DEBUG_LOG(LOGIDENTIFIER, "MediaSource duration is not a finite value, using maximum buffered time: ", rangeEnd); 1002 } 1003 999 1004 rangeStart = rangeEnd - thirtySeconds; 1000 1005 while (rangeStart > minimumRangeStart) {
Note: See TracChangeset
for help on using the changeset viewer.