diff options
author | Zaggy1024 <zaggy1024@gmail.com> | 2023-02-05 17:45:56 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-08 21:52:42 +0100 |
commit | 448d1213043ea1968ec79bf3d87a12708725faf3 (patch) | |
tree | fb7f5e91e7cb69d79e63e61d112e5e8b0a81644f /Userland | |
parent | 3bfef8bfe0d6f196c809d50140c31d4f10a6b533 (diff) | |
download | serenity-448d1213043ea1968ec79bf3d87a12708725faf3.zip |
LibVideo/Matroska: Add debug logging for seeking to cues
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp index b634c3bae9..ddde35366e 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp @@ -781,6 +781,7 @@ DecoderErrorOr<void> Reader::seek_to_cue_for_timestamp(SampleIterator& iterator, index = clamp(((timestamp.to_nanoseconds() * cue_points.size()) / TRY(segment_information()).duration()->to_nanoseconds()), 0, cue_points.size() - 1); CuePoint const* prev_cue_point = &cue_points[index]; + dbgln_if(MATROSKA_DEBUG, "Finding Matroska cue points for timestamp {}ms starting from cue at {}ms", timestamp.to_milliseconds(), prev_cue_point->timestamp().to_milliseconds()); if (prev_cue_point->timestamp() == timestamp) { TRY(iterator.seek_to_cue_point(*prev_cue_point)); @@ -788,14 +789,17 @@ DecoderErrorOr<void> Reader::seek_to_cue_for_timestamp(SampleIterator& iterator, } if (prev_cue_point->timestamp() > timestamp) { - while (index > 0 && prev_cue_point->timestamp() > timestamp) + while (index > 0 && prev_cue_point->timestamp() > timestamp) { prev_cue_point = &cue_points[--index]; + dbgln_if(MATROSKA_DEBUG, "Checking previous cue point {}ms", prev_cue_point->timestamp().to_milliseconds()); + } TRY(iterator.seek_to_cue_point(*prev_cue_point)); return {}; } while (index < cue_points.size()) { auto const& cue_point = cue_points[index++]; + dbgln_if(MATROSKA_DEBUG, "Checking future cue point {}ms", cue_point.timestamp().to_milliseconds()); if (cue_point.timestamp() > timestamp) break; prev_cue_point = &cue_point; |