mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
With the previous setup setting the time directly on the main thread, the following could occur: - HTMLMediaElement temporarily pauses playback to begin a seek. - AudioMixingSink starts an audio task to drain audio and suspend. - HTMLMediaElement starts PlaybackManager seeking to a new position. - AudioDataProvider completes the seek to the new position. - The PlaybackManager tells AudioMixingSink to set the media time, which it does so synchronously on the main thread. - At this point, the time provider corresponds to the new position. - The pause completes, and a deferred invocation sets media time to its old position again. This would result in the timeline showing the wrong position after a seek on rare occasions. Instead, always queue up a drain and suspend when setting the sink's media time. This ensures that updating the time always occurs after the pause has completed. Also, since setting the time is asynchronous now, we need to store the target time until the seeking drain completes. Otherwise, we still briefly see the previous playback position after a seek. |
||
|---|---|---|
| .. | ||
| AudioMixingSink.cpp | ||
| AudioMixingSink.h | ||
| AudioSink.h | ||
| DisplayingVideoSink.cpp | ||
| DisplayingVideoSink.h | ||
| VideoSink.h | ||