From ef249ef3197947830c324deafa00a2c0539f1642 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 9 Apr 2025 17:26:47 -0700 Subject: [PATCH] use llround Signed-off-by: Rosen Penev --- src/matroskavideo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/matroskavideo.cpp b/src/matroskavideo.cpp index 78f682f176..09dffe3acd 100644 --- a/src/matroskavideo.cpp +++ b/src/matroskavideo.cpp @@ -832,10 +832,9 @@ void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size switch (tag->_id) { case Xmp_video_Duration: if (size <= 4) { - duration_in_ms = - static_cast(getFloat(buf, bigEndian) * static_cast(time_code_scale_) * 1000.0f); + duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0f); } else { - duration_in_ms = static_cast(getDouble(buf, bigEndian) * time_code_scale_ * 1000); + duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000); } xmpData_[tag->_label] = duration_in_ms; break;