Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f920fdc60953c55385ba7515aaf6ff0cc175e8b3
      
https://github.com/WebKit/WebKit/commit/f920fdc60953c55385ba7515aaf6ff0cc175e8b3
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-09-24 (Thu, 24 Sep 2026)

  Changed paths:
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.mm

  Log Message:
  -----------
  [Tahoe DEBUG arm64] 11x 
imported/w3c/web-platform-tests/encrypted-media/drm-mp4-* (layout-tests) are 
constant crashes.
https://bugs.webkit.org/show_bug.cgi?id=323152
rdar://problem/186407831

Reviewed by Jer Noble.

When the WebCoreDecompressionSession returns a non-fatal error, the
VideoMediaSampleRenderer ask the AudioVideoRenderer to flush.
With a remote AudioVideoRenderer, some already in-flight samples can still be
be fed to the VideoMediaSampleRenderer::enqueueSample before it got to be
flushed. This scenario would cause an assertion as a contract was in place
that no sample can be enqueued while a flush is pending.

We now relax this contract as it can't be enfored by replacing the assertion
with an early return in VideoMediaSampleRenderer::enqueueSample.
During reviews two more issues were discovered:
1- samples already enqueued to the VideoMediaSampleRenderer and not yet
processed on the work queue would have continued to be fed to the 
WebCoreDecompressionSession
and produce more errors. We increase the flushId so those samples are
dropped instead.
2- If a WebCoreDecompressionSession wasn't in use (e.g. encrypted content)
m_needsFlushing was never reset.

Covered by existing tests.

* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/platform/graphics/cocoa/VideoMediaSampleRenderer.mm:
(WebCore::VideoMediaSampleRenderer::enqueueSample): Return early with logging 
if a flush is pending.
(WebCore::VideoMediaSampleRenderer::flush): Clear m_needsFlushing 
unconditionally.
(WebCore::VideoMediaSampleRenderer::invalidateDecompressionSession): Increase 
flushId so that infligh compressed samples are dropped.

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



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

Reply via email to