diff options
author | Max Kellermann <max@duempel.org> | 2014-08-29 22:43:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-29 22:52:04 +0200 |
commit | 3158955198fbdc71319cd3418523d851e6d47106 (patch) | |
tree | ab3fff73fe7efa73ed95f9998eec5da66947b4e2 /src/decoder/plugins/FfmpegDecoderPlugin.cxx | |
parent | d9d97bd17bf0d9469dcf00120d3d3fdab87299bc (diff) | |
download | mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.gz mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.xz mpd-3158955198fbdc71319cd3418523d851e6d47106.zip |
TagHandler: pass SongTime to duration()
Diffstat (limited to 'src/decoder/plugins/FfmpegDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/FfmpegDecoderPlugin.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 0693ffd43..7f4ac8bcc 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -609,9 +609,12 @@ ffmpeg_scan_stream(InputStream &is, return false; } - if (f->duration != (int64_t)AV_NOPTS_VALUE) - tag_handler_invoke_duration(handler, handler_ctx, - f->duration / AV_TIME_BASE); + if (f->duration != (int64_t)AV_NOPTS_VALUE) { + const auto duration = + SongTime::FromScale<uint64_t>(f->duration, + AV_TIME_BASE); + tag_handler_invoke_duration(handler, handler_ctx, duration); + } ffmpeg_scan_dictionary(f->metadata, handler, handler_ctx); int idx = ffmpeg_find_audio_stream(f); |