Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 575b7c2a1eb358d60f58a9f255d6b44eb5add646
https://github.com/WebKit/WebKit/commit/575b7c2a1eb358d60f58a9f255d6b44eb5add646
Author: Jean-Yves Avenard <[email protected]>
Date: 2026-05-19 (Tue, 19 May 2026)
Changed paths:
M Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.cpp
M Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.h
M Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp
M Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.h
M
Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemoteMessageReceiver.messages.in
M Source/WebKit/WebProcess/GPU/media/RemoteAudioVideoRendererState.h
Log Message:
-----------
(311867@main) PLT7 regressed for YouTube first page load
https://bugs.webkit.org/show_bug.cgi?id=315141
rdar://175874670
Reviewed by Eric Carlson.
The TimeProgressEstimator in AudioVideoRendererRemote previously released its
cached-time freeze on the first effectiveRateChanged callback, which only
indicates that the GPU has *committed* to the requested rate change — not that
playback time has actually started moving. As a result the estimator could
begin interpolating from an anchor that was still pinned at the pre-play
currentTime, producing a phantom advance of up to
remoteAudioVideoRendererUpdateInterval
seconds (250 ms at rate 1) before the GPU's first real time tick landed.
Logging on device confirmed this in practice: the GPU was observed delivering
state updates with effectiveRate=1 while currentTime was still reading as 0
for over 100ms. With the previous logic, currentTime() would then have
returned values up to 250 ms — the maximum the estimator allows itself to
extrapolate past the last anchor — even though playback in the GPU process
had not actually progressed past 0.
This change replaces that signal with a stricter one: TimeProgressEstimator
returns its last received cached time verbatim until an incoming setTime() with
a non-zero effectiveRate carries a currentTime distinct from the cached anchor.
That difference is the only proof that AVSampleBufferRenderSynchronizer's clock
has actually moved forward; without it, currentTime() short-circuits to
m_cachedTime.
To minimize the window during which currentTime() is stepped after play(), the
GPU-side periodic time observer is registered at the new
remoteAudioVideoRendererFirstTickInterval (100 ms) for the first tick after
each play(), then re-registered at remoteAudioVideoRendererUpdateInterval
(250 ms, unchanged) for steady-state. So a fresh anchor proving forward
progress arrives within ~100 ms of playback actually starting, and IPC
frequency falls back to the existing cadence afterwards.
The 100ms window is the same as what the MediaPlayerPrivateRemote was using
with the MediaPlayerPrivateMediaSourceAVFObjC running in the GPU process
to start the estimator.
* Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.cpp:
(WebKit::RemoteAudioVideoRendererProxyManager::create):
(WebKit::RemoteAudioVideoRendererProxyManager::installTimeObserver):
(WebKit::RemoteAudioVideoRendererProxyManager::play):
* Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.h:
*
Source/WebKit/GPUProcess/media/RemoteAudioVideoRendererProxyManager.messages.in:
* Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.cpp:
(WebKit::AudioVideoRendererRemote::TimeProgressEstimator::setTime):
(WebKit::AudioVideoRendererRemote::TimeProgressEstimator::pause):
(WebKit::AudioVideoRendererRemote::play):
(WebKit::AudioVideoRendererRemote::pause):
(WebKit::AudioVideoRendererRemote::setRate):
(WebKit::AudioVideoRendererRemote::MessageReceiver::timeObserverUpdate):
* Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemote.h:
*
Source/WebKit/WebProcess/GPU/media/AudioVideoRendererRemoteMessageReceiver.messages.in:
Add TimeObserverUpdate as a distinct IPC from StateUpdate so the receiver can
distinguish a periodic-time-observer-driven anchor from other state updates.
* Source/WebKit/WebProcess/GPU/media/RemoteAudioVideoRendererState.h:
Add remoteAudioVideoRendererFirstTickInterval (100 ms) alongside the existing
remoteAudioVideoRendererUpdateInterval (250 ms).
Canonical link: https://commits.webkit.org/313549@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications