summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZaggy1024 <zaggy1024@gmail.com>2023-04-11 23:42:47 -0500
committerSam Atkins <atkinssj@gmail.com>2023-04-14 12:05:52 +0100
commit41ed0cbbce76d21e253d3cd77fdb38570463c757 (patch)
tree9d8a1118a0b7c95e09e15f8e7f64343e6856f357
parentdb1be40b1319b3417d8e74fe2fc39b393fa7f15b (diff)
downloadserenity-41ed0cbbce76d21e253d3cd77fdb38570463c757.zip
LibVideo: Improve logging when PLAYBACK_MANAGER_DEBUG=on
This adds a timestamp to the debug output when presenting a frame, so it can be clear the frame spacing between a presented frame and a state change. The seeking state will also now print when it early-exits if the seek point is within the current sample's duration.
-rw-r--r--Userland/Libraries/LibVideo/PlaybackManager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibVideo/PlaybackManager.cpp b/Userland/Libraries/LibVideo/PlaybackManager.cpp
index bdba237d64..b99381de35 100644
--- a/Userland/Libraries/LibVideo/PlaybackManager.cpp
+++ b/Userland/Libraries/LibVideo/PlaybackManager.cpp
@@ -158,7 +158,7 @@ bool PlaybackManager::dispatch_frame_queue_item(FrameQueueItem&& item)
return true;
}
- dbgln_if(PLAYBACK_MANAGER_DEBUG, "Sent frame for presentation");
+ dbgln_if(PLAYBACK_MANAGER_DEBUG, "Sent frame for presentation with timestamp {}ms", item.timestamp().to_milliseconds());
dispatch_new_frame(item.bitmap());
return false;
}
@@ -575,7 +575,7 @@ private:
if (keyframe_timestamp.has_value()) {
dbgln("{} seeking to timestamp target {}ms, selected keyframe at {}ms", seek_mode_name, m_target_timestamp.to_milliseconds(), keyframe_timestamp->to_milliseconds());
} else {
- dbgln("{} seeking to timestamp target {}ms, demuxer kept its iterator position", seek_mode_name, m_target_timestamp.to_milliseconds());
+ dbgln("{} seeking to timestamp target {}ms, demuxer kept its iterator position after {}ms", seek_mode_name, m_target_timestamp.to_milliseconds(), earliest_available_sample.to_milliseconds());
}
#endif
@@ -584,10 +584,11 @@ private:
}
if (keyframe_timestamp.has_value()) {
- dbgln_if(PLAYBACK_MANAGER_DEBUG, "Timestamp is earlier than current media time, clearing queue");
+ dbgln_if(PLAYBACK_MANAGER_DEBUG, "Keyframe is nearer to the target than the current frames, clearing queue");
manager().m_frame_queue->clear();
manager().m_next_frame.clear();
} else if (m_target_timestamp >= manager().m_last_present_in_media_time && manager().m_next_frame.has_value() && manager().m_next_frame.value().timestamp() > m_target_timestamp) {
+ dbgln_if(PLAYBACK_MANAGER_DEBUG, "Target timestamp is between the last presented frame and the next frame, exiting seek at {}ms", m_target_timestamp.to_milliseconds());
manager().m_last_present_in_media_time = m_target_timestamp;
return assume_next_state();
}