From 3158955198fbdc71319cd3418523d851e6d47106 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2014 22:43:36 +0200 Subject: TagHandler: pass SongTime to duration() --- src/decoder/plugins/Mp4v2DecoderPlugin.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/decoder/plugins/Mp4v2DecoderPlugin.cxx') diff --git a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx index d59be7f09..d4f7c5843 100644 --- a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx +++ b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx @@ -256,8 +256,10 @@ mp4_scan_file(Path path_fs, return false; } - const MP4Duration dur = MP4GetTrackDuration(handle, id) / - MP4GetTrackTimeScale(handle, id); + const MP4Timestamp scale = MP4GetTrackTimeScale(handle, id); + const SongTime dur = + SongTime::FromScale(MP4GetTrackDuration(handle, id), + scale); tag_handler_invoke_duration(handler, handler_ctx, dur); const MP4Tags* tags = MP4TagsAlloc(); -- cgit v1.2.3