mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
LibVideo: Only print non-fatal playback errors when debug mode is on
This commit is contained in:
parent
393cfdd5c5
commit
e216d1a65f
1 changed files with 11 additions and 10 deletions
|
@ -109,12 +109,13 @@ Time PlaybackManager::duration()
|
||||||
|
|
||||||
void PlaybackManager::on_decoder_error(DecoderError error)
|
void PlaybackManager::on_decoder_error(DecoderError error)
|
||||||
{
|
{
|
||||||
dbgln("Playback error encountered: {}", error.string_literal());
|
|
||||||
switch (error.category()) {
|
switch (error.category()) {
|
||||||
case DecoderErrorCategory::EndOfStream:
|
case DecoderErrorCategory::EndOfStream:
|
||||||
|
dbgln_if(PLAYBACK_MANAGER_DEBUG, "{}", error.string_literal());
|
||||||
set_playback_status(PlaybackStatus::Stopped);
|
set_playback_status(PlaybackStatus::Stopped);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
dbgln("Playback error encountered: {}", error.string_literal());
|
||||||
set_playback_status(PlaybackStatus::Corrupted);
|
set_playback_status(PlaybackStatus::Corrupted);
|
||||||
m_main_loop.post_event(m_event_handler, make<DecoderErrorEvent>(move(error)));
|
m_main_loop.post_event(m_event_handler, make<DecoderErrorEvent>(move(error)));
|
||||||
break;
|
break;
|
||||||
|
@ -201,7 +202,7 @@ bool PlaybackManager::decode_and_queue_one_sample()
|
||||||
({ \
|
({ \
|
||||||
auto _temporary_result = ((expression)); \
|
auto _temporary_result = ((expression)); \
|
||||||
if (_temporary_result.is_error()) { \
|
if (_temporary_result.is_error()) { \
|
||||||
dbgln("Enqueued decoder error: {}", _temporary_result.error().string_literal()); \
|
dbgln_if(PLAYBACK_MANAGER_DEBUG, "Enqueued decoder error: {}", _temporary_result.error().string_literal()); \
|
||||||
m_frame_queue->enqueue(FrameQueueItem::error_marker(_temporary_result.release_error())); \
|
m_frame_queue->enqueue(FrameQueueItem::error_marker(_temporary_result.release_error())); \
|
||||||
return false; \
|
return false; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue