1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

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.
This commit is contained in:
Zaggy1024 2022-11-09 06:52:37 -06:00 committed by Ali Mohammad Pur
parent a2a4ad3b9d
commit 18a6a1dd10
4 changed files with 98 additions and 46 deletions

View file

@ -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;