Skip to content

Commit

Permalink
[WEBM] Seeking is broken
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=276171
rdar://128620836

Reviewed by Jer Noble and Youenn Fablet.

Regression was introduced in 273109@main
We never flushed the AVSampleBufferDisplayLayer nor re-enqueued new frames to be displayed
when seeking backward.

Added test

* LayoutTests/media/media-vp8-webm-seek-to-start-expected.html: Added.
* LayoutTests/media/media-vp8-webm-seek-to-start.html: Added.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::seekInternal):

Canonical link: https://commits.webkit.org/280648@main
  • Loading branch information
jyavenard committed Jul 4, 2024
1 parent 1d7c9c3 commit e5a7357
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions LayoutTests/media/media-vp8-webm-seek-to-start-expected.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<body>
<video src="content/test-vp8.webm"></video>
<div>
<span>END OF TEST<br></span>
</div>
</body>
</html>
26 changes: 26 additions & 0 deletions LayoutTests/media/media-vp8-webm-seek-to-start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<html>
<meta name="fuzzy" content="maxDifference=0-2; totalPixels=0-275" />
<head>
<title>webm file with vp8</title>
<script>window.requirePixelDump = true</script>
<script src="video-test.js"></script>
<script>
async function init()
{
let v = document.getElementsByTagName('video')[0];
v.src = "content/test-vp8.webm";
await waitFor(v, 'canplay', true);
v.play();
// duration of the last frame.
v.currentTime = v.duration - 0.02;
await Promise.all([ waitFor(v, 'seeked', true), waitFor(v, 'ended', true) ]);
v.currentTime = 0;
await waitFor(v, 'seeked', true);
endTest();
}
</script>
</head>
<body onload="init();">
<video/>
</body>
</html>
1 change: 1 addition & 0 deletions LayoutTests/platform/mac-site-isolation/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -10815,6 +10815,7 @@ media/media-source/media-managedmse-seek.html [ ImageOnlyFailure ]
media/media-source/media-source-video-renders.html [ ImageOnlyFailure ]
media/media-sources-selection.html [ ImageOnlyFailure ]
media/media-vp8-webm.html [ ImageOnlyFailure ]
media/media-vp8-webm-seek-to-start.html [ ImageOnlyFailure ]
media/track/track-webvtt-no-snap-to-lines-overlap.html [ ImageOnlyFailure ]
media/track/track-webvtt-snap-to-lines-inline-style.html [ ImageOnlyFailure ]
media/track/track-webvtt-snap-to-lines-left-right.html [ ImageOnlyFailure ]
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/platform/mac-wk1/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ media/W3C/video/canPlayType/canPlayType_two_implies_one_2.html [ Failure ]
media/media-can-play-webm.html [ Failure ]
media/media-vp8-webm-error.html [ Failure ]
media/media-vp8-webm.html [ Skip ]
media/media-vp8-webm-seek-to-start.html [ Skip ]
media/video-src-webm-blob.html [ Failure ]
media/track/media-audio-track.html [ Failure ]
media/media-sources-selection.html [ ImageOnlyFailure ]
Expand Down
3 changes: 2 additions & 1 deletion LayoutTests/platform/mac-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,8 @@ http/tests/contentextensions/block-everything-unless-domain-redirect.py [ Pass F

webkit.org/b/262411 [ Sonoma+ ] fast/scrolling/scroll-to-anchor-zoomed-header.html [ Pass Crash ]

[ Ventura+ ] media/media-vp8-webm.html [ ImageOnlyFailure ] # Missing AVSampleBufferDisplayLayer's ReadyForDisplayDidChangeNotification
[ Ventura ] media/media-vp8-webm.html [ ImageOnlyFailure ] # Missing AVSampleBufferDisplayLayer's ReadyForDisplayDidChangeNotification
[ Ventura ] media/media-vp8-webm-seek-to-start.html [ ImageOnlyFailure ] # Missing AVSampleBufferDisplayLayer's ReadyForDisplayDidChangeNotification

webkit.org/b/263136 [ Sonoma+ ] imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-overrides-uax-behavior-011.html [ ImageOnlyFailure ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ static bool isCopyDisplayedPixelBufferAvailable()

auto pendingSeek = std::exchange(m_pendingSeek, { }).value();
m_lastSeekTime = pendingSeek.time;
[m_synchronizer setRate:0 time:PAL::toCMTime(m_lastSeekTime)];

m_seekState = Seeking;

Expand All @@ -386,6 +385,7 @@ static bool isCopyDisplayedPixelBufferAvailable()
}

flush();
[m_synchronizer setRate:0 time:PAL::toCMTime(m_lastSeekTime)];

for (auto& trackBufferPair : m_trackBufferMap) {
TrackBuffer& trackBuffer = trackBufferPair.second;
Expand Down

0 comments on commit e5a7357

Please sign in to comment.