1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:57:35 +00:00

LibVideo/PlaybackManager: Don't crash when demuxer seek throws an error

`seek_demuxer_to_most_recent_keyframe()` wasn't correctly returning in
cases where an error was thrown by the demuxer. To avoid this, the
function now returns the error, and the playback state handler must act
on it instead, allowing it to exit the seeking state early.
This commit is contained in:
Zaggy1024 2023-06-24 04:57:27 -05:00 committed by Tim Flynn
parent b94c132dd1
commit 1789905d4a
2 changed files with 10 additions and 7 deletions

View file

@ -158,7 +158,7 @@ private:
void timer_callback();
// This must be called with m_demuxer_mutex locked!
Optional<Duration> seek_demuxer_to_most_recent_keyframe(Duration timestamp, Optional<Duration> earliest_available_sample = OptionalNone());
DecoderErrorOr<Optional<Duration>> seek_demuxer_to_most_recent_keyframe(Duration timestamp, Optional<Duration> earliest_available_sample = OptionalNone());
Optional<FrameQueueItem> dequeue_one_frame();
void set_state_update_timer(int delay_ms);