Changeset 273799 in webkit
- Timestamp:
- Mar 2, 2021, 7:09:07 PM (6 years ago)
- Location:
- branches/safari-612.1.5-branch
- Files:
-
- 6 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-bigsur/media/media-source (added)
-
LayoutTests/platform/mac-bigsur/media/media-source/content (added)
-
LayoutTests/platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis-manifest.json (added)
-
LayoutTests/platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis.webm (added)
-
LayoutTests/platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial-expected.txt (added)
-
LayoutTests/platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.1.5-branch/LayoutTests/ChangeLog
r273798 r273799 1 2021-03-02 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r273513. rdar://problem/74953307 4 5 [Cocoa] Appending a partial segment of a WebM audio file results in no additional samples 6 https://bugs.webkit.org/show_bug.cgi?id=222407 7 <rdar://74610383> 8 9 Reviewed by Eric Carlson. 10 11 Source/WebCore: 12 13 Test: media/media-source/media-source-webm-vorbis-partial.html 14 15 When appending a partial WebM segment, it can occur that the parser is mid-way through 16 parsing a Block or SimpleBlock, and is waiting for enough data to be appended to construct a 17 full sample. However, previous appends are not accounted for when calculated the amount of 18 data to be requested from the reader, which both results in too much data read and a 19 miscalculation of the `bytesRemaining` out-param. This causes all subsequent appends to 20 generate no samples, leading to an apparent stall in playback. 21 22 Add a new ivar to track the number of partial bytes read, and use that value to calculate 23 the number of bytes yet to be parsed. 24 25 * platform/graphics/cocoa/SourceBufferParserWebM.cpp: 26 (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): 27 * platform/graphics/cocoa/SourceBufferParserWebM.h: 28 29 LayoutTests: 30 31 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis-manifest.json: Added. 32 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis.webm: Added. 33 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial-expected.txt: Added. 34 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial.html: Added. 35 36 37 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273513 268f45cc-cd09-0410-ab3c-d52691b4dbfc 38 39 2021-02-25 Jer Noble <jer.noble@apple.com> 40 41 [Cocoa] Appending a partial segment of a WebM audio file results in no additional samples 42 https://bugs.webkit.org/show_bug.cgi?id=222407 43 <rdar://74610383> 44 45 Reviewed by Eric Carlson. 46 47 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis-manifest.json: Added. 48 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis.webm: Added. 49 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial-expected.txt: Added. 50 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial.html: Added. 51 1 52 2021-03-02 Alan Coon <alancoon@apple.com> 2 53 -
branches/safari-612.1.5-branch/Source/WebCore/ChangeLog
r273798 r273799 1 2021-03-02 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r273513. rdar://problem/74953307 4 5 [Cocoa] Appending a partial segment of a WebM audio file results in no additional samples 6 https://bugs.webkit.org/show_bug.cgi?id=222407 7 <rdar://74610383> 8 9 Reviewed by Eric Carlson. 10 11 Source/WebCore: 12 13 Test: media/media-source/media-source-webm-vorbis-partial.html 14 15 When appending a partial WebM segment, it can occur that the parser is mid-way through 16 parsing a Block or SimpleBlock, and is waiting for enough data to be appended to construct a 17 full sample. However, previous appends are not accounted for when calculated the amount of 18 data to be requested from the reader, which both results in too much data read and a 19 miscalculation of the `bytesRemaining` out-param. This causes all subsequent appends to 20 generate no samples, leading to an apparent stall in playback. 21 22 Add a new ivar to track the number of partial bytes read, and use that value to calculate 23 the number of bytes yet to be parsed. 24 25 * platform/graphics/cocoa/SourceBufferParserWebM.cpp: 26 (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): 27 * platform/graphics/cocoa/SourceBufferParserWebM.h: 28 29 LayoutTests: 30 31 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis-manifest.json: Added. 32 * platform/mac-bigsur/media/media-source/content/test-48kHz-vorbis.webm: Added. 33 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial-expected.txt: Added. 34 * platform/mac-bigsur/media/media-source/media-source-webm-vorbis-partial.html: Added. 35 36 37 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273513 268f45cc-cd09-0410-ab3c-d52691b4dbfc 38 39 2021-02-25 Jer Noble <jer.noble@apple.com> 40 41 [Cocoa] Appending a partial segment of a WebM audio file results in no additional samples 42 https://bugs.webkit.org/show_bug.cgi?id=222407 43 <rdar://74610383> 44 45 Reviewed by Eric Carlson. 46 47 Test: media/media-source/media-source-webm-vorbis-partial.html 48 49 When appending a partial WebM segment, it can occur that the parser is mid-way through 50 parsing a Block or SimpleBlock, and is waiting for enough data to be appended to construct a 51 full sample. However, previous appends are not accounted for when calculated the amount of 52 data to be requested from the reader, which both results in too much data read and a 53 miscalculation of the `bytesRemaining` out-param. This causes all subsequent appends to 54 generate no samples, leading to an apparent stall in playback. 55 56 Add a new ivar to track the number of partial bytes read, and use that value to calculate 57 the number of bytes yet to be parsed. 58 59 * platform/graphics/cocoa/SourceBufferParserWebM.cpp: 60 (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): 61 * platform/graphics/cocoa/SourceBufferParserWebM.h: 62 1 63 2021-03-02 Alan Coon <alancoon@apple.com> 2 64 -
branches/safari-612.1.5-branch/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp
r272758 r273799 1230 1230 m_packetData.resize(m_packetBytesRead + metadata.size); 1231 1231 size_t packetDataOffset = m_packetBytesRead; 1232 1233 ASSERT(m_partialBytesRead < metadata.size); 1232 1234 size_t bytesToRead = metadata.size; 1235 if (m_partialBytesRead && m_partialBytesRead < bytesToRead) 1236 bytesToRead -= m_partialBytesRead; 1233 1237 while (bytesToRead) { 1234 1238 uint64_t bytesRead; … … 1239 1243 1240 1244 // FIXME: We can't yet handle parsing a Frame that doesn't have all its memory available. 1241 if (status.code == webm::Status::kOkPartial || status.code == webm::Status::kWouldBlock) 1245 if (status.code == webm::Status::kOkPartial || status.code == webm::Status::kWouldBlock) { 1246 m_partialBytesRead += bytesRead; 1242 1247 return status; 1248 } 1249 1250 m_partialBytesRead = 0; 1243 1251 } 1244 1252 -
branches/safari-612.1.5-branch/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h
r273089 r273799 216 216 size_t m_packetBytesRead { 0 }; 217 217 size_t m_byteOffset { 0 }; 218 size_t m_partialBytesRead { 0 }; 218 219 Vector<AudioStreamPacketDescription> m_packetDescriptions; 219 220
Note:
See TracChangeset
for help on using the changeset viewer.