1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibVideo: Add a hook to notify clients upon reaching end of the stream

This commit is contained in:
Timothy Flynn 2023-04-10 19:51:03 -04:00 committed by Linus Groh
parent fe66490399
commit 33047b38ec
2 changed files with 5 additions and 0 deletions

View file

@ -129,6 +129,10 @@ void PlaybackManager::dispatch_decoder_error(DecoderError error)
case DecoderErrorCategory::EndOfStream:
dbgln_if(PLAYBACK_MANAGER_DEBUG, "{}", error.string_literal());
TRY_OR_FATAL_ERROR(m_playback_handler->stop());
if (on_end_of_stream)
on_end_of_stream();
break;
default:
dbgln("Playback error encountered: {}", error.string_literal());