Skip to content

Commit 316cb55

Browse files
committed
use llround
Signed-off-by: Rosen Penev <[email protected]>
1 parent 5951e2f commit 316cb55

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/matroskavideo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,9 @@ void MatroskaVideo::decodeDateTags(const MatroskaTag* tag, const byte* buf, size
832832
switch (tag->_id) {
833833
case Xmp_video_Duration:
834834
if (size <= 4) {
835-
duration_in_ms =
836-
static_cast<int64_t>(getFloat(buf, bigEndian) * static_cast<float>(time_code_scale_) * 1000.0f);
835+
duration_in_ms = std::llround(getFloat(buf, bigEndian) * time_code_scale_ * 1000.0f);
837836
} else {
838-
duration_in_ms = static_cast<int64_t>(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
837+
duration_in_ms = std::llround(getDouble(buf, bigEndian) * time_code_scale_ * 1000);
839838
}
840839
xmpData_[tag->_label] = duration_in_ms;
841840
break;

0 commit comments

Comments
 (0)