LibMedia: Ensure that video sink updates only resolve current seeks

The same check as in the wake handler's deferred dispatch.
This commit is contained in:
Zaggy1024 2026-06-09 17:14:03 -05:00 committed by Gregory Bertilson
parent 4fcb714327
commit fa0c02acb1

View file

@ -155,7 +155,9 @@ DisplayingVideoSinkUpdateResult DisplayingVideoSink::update()
// Dispatch the new state with a deferred invoke to avoid reentrancy. This prevents a seek from resolving while
// an update is being processed.
Core::deferred_invoke([self = NonnullRefPtr(*this), last_status] {
Core::deferred_invoke([self = NonnullRefPtr(*this), last_status, seek_id = m_seek_id] {
if (seek_id != self->m_seek_id)
return;
self->dispatch_state_if_changed(last_status);
});