diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2022-11-09 06:52:37 -0600 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-11-10 12:32:55 +0330 |
commit | 18a6a1dd1029f7da200680ff3f6b7d8e134ec6a3 (patch) | |
tree | 0e23288158bf9066abd7a0c92a5ee8249b0832d3 /Userland/Applications/VideoPlayer | |
parent | a2a4ad3b9dfa77cce8d27872631ad3928f918306 (diff) | |
download | serenity-18a6a1dd1029f7da200680ff3f6b7d8e134ec6a3.zip |
LibVideo: Handle corrupted video errors without spamming dialogs
No longer will the video player explode with error dialogs that then
lock the user out of closing them.
To avoid issues where the playback state becomes invalid when an error
occurs, I've made all decoder errors pass through the frame queue.
This way, when a video is corrupted, there should be no chance that the
playback state becomes invalid due to setting the state to Corrupted
in the event handler while a presentation event is still pending.
Or at least I think that was what caused some issues I was seeing :^)
This system should be a lot more robust if any future errors need to be
handled.
Diffstat (limited to 'Userland/Applications/VideoPlayer')
-rw-r--r-- | Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/Applications/VideoPlayer/VideoPlayerWidget.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp index 1145948777..31d5972503 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp @@ -127,7 +127,7 @@ void VideoPlayerWidget::toggle_pause() resume_playback(); } -void VideoPlayerWidget::on_decoding_error(Video::DecoderError error) +void VideoPlayerWidget::on_decoding_error(Video::DecoderError const& error) { StringView text_format; diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.h b/Userland/Applications/VideoPlayer/VideoPlayerWidget.h index 738ad06025..e52f5e920c 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.h +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.h @@ -35,7 +35,7 @@ private: VideoPlayerWidget(GUI::Window&); void update_play_pause_icon(); - void on_decoding_error(Video::DecoderError); + void on_decoding_error(Video::DecoderError const&); void display_next_frame(); void cycle_sizing_modes(); |