mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
committed by
Gregory Bertilson
parent
a8144a2608
commit
cb852a7e19
Notes:
github-actions[bot]
2026-04-10 09:09:30 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/cb852a7e19c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8850
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user