aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/plugins/Mp4v2DecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/Mp4v2DecoderPlugin.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
index ef5284437..d59be7f09 100644
--- a/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
+++ b/src/decoder/plugins/Mp4v2DecoderPlugin.cxx
@@ -149,7 +149,8 @@ mp4_file_decode(Decoder &mpd_decoder, Path path_fs)
/* initialize the MPD core */
const MP4Timestamp scale = MP4GetTrackTimeScale(handle, track);
- const float duration = ((float)MP4GetTrackDuration(handle, track)) / scale + 0.5f;
+ const SongTime duration = SongTime::FromScale<uint64_t>(MP4GetTrackDuration(handle, track),
+ scale);
const MP4SampleId num_samples = MP4GetTrackNumberOfSamples(handle, track);
decoder_initialized(mpd_decoder, audio_format, true, duration);