LibWeb: Don't fast seek when seeking media to its current position

This ensures that we don't seek away from the end of the file if we're
already there and fastSeek() is called with a timestamp at or past the
end.
This commit is contained in:
Zaggy1024
2025-11-03 18:55:09 -06:00
committed by Gregory Bertilson
parent a8144a2608
commit cb852a7e19
Notes: github-actions[bot] 2026-04-10 09:09:30 +00:00

View File

@@ -2375,9 +2375,9 @@ void HTMLMediaElement::seek_element(double playback_position, MediaSeekMode seek
// playback position, then the adjusted new playback position must also be after the current playback position.
auto manager_seek_mode = Media::SeekMode::Accurate;
if (seek_mode == MediaSeekMode::ApproximateForSpeed) {
if (playback_position <= current_playback_position())
if (playback_position < current_playback_position())
manager_seek_mode = Media::SeekMode::FastBefore;
else
else if (playback_position > current_playback_position())
manager_seek_mode = Media::SeekMode::FastAfter;
}