From 2a9fb8b439f4180ca6b3c790b712ba8cf666b68c Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Sun, 13 Nov 2022 19:13:50 -0600 Subject: LibVideo: Give Matroska duration an absolute value getter Previously, the duration had to be multiplied by timestamp_scale and converted to a Time object, now SegmentInformation::duration() does it itself. --- Userland/Libraries/LibVideo/Containers/Matroska/Document.h | 12 +++++++++--- .../LibVideo/Containers/Matroska/MatroskaDemuxer.cpp | 6 ++---- Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp | 4 ++-- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'Userland/Libraries/LibVideo') diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h index b60051d0ad..195647fc1a 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Document.h +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Document.h @@ -31,14 +31,20 @@ public: void set_muxing_app(String muxing_app) { m_muxing_app = move(muxing_app); } Utf8View writing_app() const { return Utf8View(m_writing_app); } void set_writing_app(String writing_app) { m_writing_app = move(writing_app); } - Optional duration() const { return m_duration; } - void set_duration(double duration) { m_duration.emplace(duration); } + Optional duration_unscaled() const { return m_duration_unscaled; } + void set_duration_unscaled(double duration) { m_duration_unscaled.emplace(duration); } + Optional