Changeset 237657 in webkit
- Timestamp:
- Oct 31, 2018 3:05:51 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r237656 r237657 1 2018-10-31 Alicia Boya García <aboya@igalia.com> 2 3 [MSE] Use tolerance when growing the coded frame group 4 https://bugs.webkit.org/show_bug.cgi?id=190085 5 6 Reviewed by Jer Noble. 7 8 A test simulating unordered appends with imprecise timestamps, 9 overlapping <1ms (replicating a typical WebM 30fps video file) is 10 added. 11 12 * media/media-source/media-source-append-acb-tolerance.html: Added. 13 1 14 2018-10-31 Devin Rousso <drousso@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r237655 r237657 1 2018-10-31 Alicia Boya García <aboya@igalia.com> 2 3 [MSE] Use tolerance when growing the coded frame group 4 https://bugs.webkit.org/show_bug.cgi?id=190085 5 6 Reviewed by Jer Noble. 7 8 Test: media/media-source/media-source-append-acb-tolerance.html 9 10 This patch introduces a millisecond tolerance in the range of 11 potential frames that should be erased frame from the track buffer 12 when the coded frame group is growing. 13 14 This is necessary because some files have imprecise overlapping 15 timestamps (especially WebM files). 16 17 This fixes a stall when seeking back and forth in YouTube with WebM 18 video. 19 20 A test case simulating the problem with video/mock using timestamps 21 similar to those of a typical 30 fps WebM video is also added. 22 23 * Modules/mediasource/SourceBuffer.cpp: 24 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 25 1 26 2018-10-31 Jer Noble <jer.noble@apple.com> 2 27 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r237274 r237657 1646 1646 } 1647 1647 1648 // There are many files out there where the frame times are not perfectly contiguous and may have small overlaps 1649 // between the beginning of a frame and the end of the previous one; therefore a tolerance is needed whenever 1650 // durations are considered. 1651 // For instance, most WebM files are muxed rounded to the millisecond (the default TimecodeScale of the format) 1652 // but their durations use a finer timescale (causing a sub-millisecond overlap). More rarely, there are also 1653 // MP4 files with slightly off tfdt boxes, presenting a similar problem at the beginning of each fragment. 1654 const MediaTime contiguousFrameTolerance = MediaTime(1, 1000); 1655 1648 1656 // If highest presentation timestamp for track buffer is set and less than or equal to presentation timestamp 1649 1657 if (trackBuffer.highestPresentationTimestamp.isValid() && trackBuffer.highestPresentationTimestamp <= presentationTimestamp) { … … 1659 1667 1660 1668 MediaTime highestBufferedTime = trackBuffer.buffered.maximumBufferedTime(); 1669 MediaTime eraseBeginTime = trackBuffer.highestPresentationTimestamp; 1670 MediaTime eraseEndTime = frameEndTimestamp - contiguousFrameTolerance; 1661 1671 1662 1672 PresentationOrderSampleMap::iterator_range range; 1663 1673 if (highestBufferedTime - trackBuffer.highestPresentationTimestamp < trackBuffer.lastFrameDuration) 1664 1674 // If the new frame is at the end of the buffered ranges, perform a sequential scan from end (O(1)). 1665 range = trackBuffer.samples.presentationOrder().findSamplesBetweenPresentationTimesFromEnd( trackBuffer.highestPresentationTimestamp, frameEndTimestamp);1675 range = trackBuffer.samples.presentationOrder().findSamplesBetweenPresentationTimesFromEnd(eraseBeginTime, eraseEndTime); 1666 1676 else 1667 1677 // In any other case, perform a binary search (O(log(n)). 1668 range = trackBuffer.samples.presentationOrder().findSamplesBetweenPresentationTimes( trackBuffer.highestPresentationTimestamp, frameEndTimestamp);1678 range = trackBuffer.samples.presentationOrder().findSamplesBetweenPresentationTimes(eraseBeginTime, eraseEndTime); 1669 1679 1670 1680 if (range.first != trackBuffer.samples.presentationOrder().end()) … … 1727 1737 // In order to check whether a frame should be added to the decode queue we check whether it starts after the 1728 1738 // lastEnqueuedDecodeEndTime or even a bit before that to accomodate files with imprecise timing information. 1729 //1730 // There are many files out there where the frame times are not perfectly contiguous, therefore a tolerance is needed.1731 // For instance, most WebM files are muxed rounded to the millisecond (the default TimecodeScale of the format).1732 const MediaTime contiguousFrameTolerance = MediaTime(1, 1000);1733 1739 if (trackBuffer.lastEnqueuedDecodeEndTime.isInvalid() || decodeTimestamp >= (trackBuffer.lastEnqueuedDecodeEndTime - contiguousFrameTolerance)) { 1734 1740 DecodeOrderSampleMap::KeyType decodeKey(sample.decodeTime(), sample.presentationTime());
Note: See TracChangeset
for help on using the changeset viewer.