aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-29 22:43:36 +0200
committerMax Kellermann <max@duempel.org>2014-08-29 22:52:04 +0200
commit3158955198fbdc71319cd3418523d851e6d47106 (patch)
treeab3fff73fe7efa73ed95f9998eec5da66947b4e2 /src/decoder/plugins/Mp4v2DecoderPlugin.cxx
parentd9d97bd17bf0d9469dcf00120d3d3fdab87299bc (diff)
downloadmpd-3158955198fbdc71319cd3418523d851e6d47106.tar.gz
mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.xz
mpd-3158955198fbdc71319cd3418523d851e6d47106.zip
TagHandler: pass SongTime to duration()
Diffstat (limited to 'src/decoder/plugins/Mp4v2DecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/Mp4v2DecoderPlugin.cxx6
1 files changed, 4 insertions, 2 deletions
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<uint64_t>(MP4GetTrackDuration(handle, id),
+ scale);
tag_handler_invoke_duration(handler, handler_ctx, dur);
const MP4Tags* tags = MP4TagsAlloc();