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;