Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ae61725f4cb3e96e996777e60f91f1dab925aada
      
https://github.com/WebKit/WebKit/commit/ae61725f4cb3e96e996777e60f91f1dab925aada
  Author: David Kilzer <[email protected]>
  Date:   2026-07-24 (Fri, 24 Jul 2026)

  Changed paths:
    M Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp

  Log Message:
  -----------
  AudioVideoRendererRemote::finishSeek should handle a superseded seek instead 
of asserting
<https://bugs.webkit.org/show_bug.cgi?id=320093>
<rdar://182961418>

Reviewed by Jean-Yves Avenard.

`AudioVideoRendererRemote::m_seeking` is an atomic flag, but its
accesses are split across two work queues.
`AudioVideoRendererRemote::prepareToSeek()` sets it and
`AudioVideoRendererRemote::finishSeek()` reads it while those methods
run on `MediaSourcePrivateAVFObjC::queueSingleton()`, whereas the
GPU-reply `whenSettled` callbacks inside them clear it on
`AudioVideoRendererRemote::queueSingleton()`.  With no ordering between
the two queues, a superseding seek whose `prepareToSeek()` reply is
definite (or a GPU-not-running path) can clear `m_seeking` while an
earlier seek is still being finished, so `finishSeek()` is entered with
`m_seeking` already false.  The debug `ASSERT(m_seeking)` at that entry
treats this internally-reachable state as caller misuse and traps,
which is the source of the crashes seen on Debug builds.
`AudioVideoRendererRemote::cancelPendingSeek()` does not close the
window: it can neither stop an in-flight GPU round trip from settling
and clearing the flag, nor a fresh `prepareToSeek()` from re-setting it.

Treat a no-longer-seeking state as a superseded seek and reject early,
matching `AudioVideoRendererAVFObjC::finishSeek()`, which already
handles the same interface state this way for the non-GPU-process
renderer.  Besides removing the Debug assertion, this also stops a
superseded seek from issuing a redundant `FinishSeek` to the GPU
process and completing the player to a stale seek time in release
builds.

These existing media-source seek tests exercise the path and hit the
assertion crash on the bots:

    media/media-source/media-source-muted-scroll-and-seek-crash.html
    media/media-source/media-source-no-preload-set-duration-crash.html
    media/media-source/media-source-real-scrub-then-play.html
    media/media-source/media-source-seek-and-play.html

* Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp:
(WebKit::AudioVideoRendererRemote::finishSeek):

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



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

Reply via email to