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/OpusDecoderPlugin.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/OpusDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/OpusDecoderPlugin.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx index 2de827c7f..97c81984c 100644 --- a/src/decoder/plugins/OpusDecoderPlugin.cxx +++ b/src/decoder/plugins/OpusDecoderPlugin.cxx @@ -441,9 +441,12 @@ mpd_opus_scan_stream(InputStream &is, } } - if (packet.e_o_s || OggSeekFindEOS(oy, os, packet, is)) - tag_handler_invoke_duration(handler, handler_ctx, - packet.granulepos / opus_sample_rate); + if (packet.e_o_s || OggSeekFindEOS(oy, os, packet, is)) { + const auto duration = + SongTime::FromScale<uint64_t>(packet.granulepos, + opus_sample_rate); + tag_handler_invoke_duration(handler, handler_ctx, duration); + } ogg_stream_clear(&os); |