Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7cb3a439c8326c8d01124a77b705c2c2f224d008
      
https://github.com/WebKit/WebKit/commit/7cb3a439c8326c8d01124a77b705c2c2f224d008
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2025-11-25 (Tue, 25 Nov 2025)

  Changed paths:
    A 
LayoutTests/media/media-source/media-source-seek-twice-unbuffered-expected.txt
    A LayoutTests/media/media-source/media-source-seek-twice-unbuffered.html
    M Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.mm

  Log Message:
  -----------
  espn.com: Unable to play Monday Night Football (MNF) videos from "Watch" page 
in Safari (Live content on Mondays only)
rdar://159133059
https://bugs.webkit.org/show_bug.cgi?id=303085

Reviewed by Youenn Fablet.

The issue has been a long standing one.
If content was removed from the sourceBuffer while we're in the middle of a 
seek,
the renderer would have been flushed and the flag to indicate that a frame was 
available was set to false.
When content was then re-added, we attempted to seek again, however as the time 
hadn't changed
we simply assumed the seek was complete.
As MediaPlayerPrivateMediaSourceAVFObjC would wait for 
allRenderersHaveAvailableSamples
to become true to change the readyState from HaveMetadata to HaveCurrentData, 
and this condition
never occurred as no frame was ever re-enqueued: the seek never completed.

As a workaround, we only shorcut the seek when the currentTime will not change
if we do have received samples for all tracks; otherwise we will request a flush
which will automatically re-enqueue new frames. It may cause an unnecessary
flush and re-enqueue, but as this condition only occurs if we attempt to seek
twice to the same location, the performance impact is small.

Added test.
Test: media/media-source/media-source-seek-twice-unbuffered.html
* 
LayoutTests/media/media-source/media-source-seek-twice-unbuffered-expected.txt: 
Added.
* LayoutTests/media/media-source/media-source-seek-twice-unbuffered.html: Added.
* Source/WebCore/platform/graphics/avfoundation/AudioVideoRendererAVFObjC.mm:
(WebCore::AudioVideoRendererAVFObjC::seekTo):

Canonical link: https://commits.webkit.org/303550@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to