mirror of
https://github.com/servo/servo
synced 2026-05-13 02:17:06 +02:00
The low-level media `seek` request could be initiated by script (DOM method call or setting of an IDL attribute), by the user agent (seeking data) or by the media engine itself (e.g. gst_play_set_rate()). And to distinguish between them we will use the latest seek position (in seconds) to be able abort processing the `seek` algorithm steps (13-17) for a `seek` request initiated by the media engine. See https://html.spec.whatwg.org/multipage/#dom-media-seek If the `seeking` is in progress, any callback which affects the current playback position (`position changed`, `end of the playback`) shouldn't be processed (event marshalling over IPC router is non-state conditional). Testing: Regression in the following test causes by gstreamer issue when the `gst_play_set_rate()` overrides the latest seek requested position unconditionally and the user agent receives the `seek completion` event with the unexpected seek position (0.5+ instead of 0.0). - html/semantics/embedded-content/media-elements/preserves-pitch.html See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4762 Fixes: https://github.com/servo/servo/issues/37057 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>