Changeset 274485 in webkit
- Timestamp:
- Mar 16, 2021, 9:53:47 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cocoa/SourceBufferParserWebM.cpp (modified) (2 diffs)
-
platform/graphics/cocoa/SourceBufferParserWebM.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274482 r274485 1 2021-03-16 Jer Noble <jer.noble@apple.com> 2 3 [Cocoa] YouTube audio stalls occasionally 4 https://bugs.webkit.org/show_bug.cgi?id=223233 5 <rdar://75057532> 6 7 Reviewed by Eric Carlson. 8 9 In r273513, we added support for parsing of audio frames which spanned 10 appends. But in so doing, left in a bug where the size and starting byte 11 offset of those audio frames was miscalculated. Previously, the starting 12 byte offset was reset during each pass through consumeFrameData(), and the 13 size of the m_packetData was increased by the full packet size each pass 14 as well, leading to both an incorrect starting point for the frame and an 15 incorrect overall size of the combined packet data. This lead to a decoding 16 error when the parser hit the empty frame bytes after the last successful 17 partial parse. 18 19 Now, we will add explicit tracking of the current frame's starting byte 20 offset as well as the frame's size, reset after each successful full frame 21 parse. 22 23 * platform/graphics/cocoa/SourceBufferParserWebM.cpp: 24 (WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData): 25 * platform/graphics/cocoa/SourceBufferParserWebM.h: 26 1 27 2021-03-16 Youenn Fablet <youenn@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp
r273513 r274485 1225 1225 } 1226 1226 1227 m_packetData.resize(m_packetBytesRead + metadata.size); 1228 size_t packetDataOffset = m_packetBytesRead; 1227 if (!m_currentPacketSize) { 1228 m_currentPacketSize = metadata.size; 1229 m_packetData.grow(m_packetData.size() + metadata.size); 1230 } 1231 1232 if (!m_currentPacketByteOffset) 1233 m_currentPacketByteOffset = m_packetBytesRead; 1229 1234 1230 1235 ASSERT(m_partialBytesRead < metadata.size); … … 1276 1281 } 1277 1282 1278 m_packetDescriptions.append({ static_cast<int64_t>(packetDataOffset), 0, static_cast<UInt32>(metadata.size) }); 1283 m_packetDescriptions.append({ static_cast<int64_t>(*m_currentPacketByteOffset), 0, static_cast<UInt32>(*m_currentPacketSize) }); 1284 m_currentPacketByteOffset = WTF::nullopt; 1285 m_currentPacketSize = WTF::nullopt; 1286 1279 1287 auto sampleDuration = CMTimeGetSeconds(CMTimeSubtract(presentationTime, m_samplePresentationTime)) + CMTimeGetSeconds(m_packetDuration) * sampleCount; 1280 1288 if (sampleDuration >= m_minimumSampleDuration) -
trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.h
r273513 r274485 214 214 CMTime m_packetDuration; 215 215 Vector<uint8_t> m_packetData; 216 Optional<size_t> m_currentPacketByteOffset; 217 Optional<size_t> m_currentPacketSize; 216 218 size_t m_packetBytesRead { 0 }; 217 219 size_t m_byteOffset { 0 };
Note:
See TracChangeset
for help on using the changeset viewer.