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/VorbisDecoderPlugin.cxx | |
parent | d9d97bd17bf0d9469dcf00120d3d3fdab87299bc (diff) | |
download | mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.gz mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.xz mpd-3158955198fbdc71319cd3418523d851e6d47106.zip |
TagHandler: pass SongTime to duration()
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/VorbisDecoderPlugin.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/plugins/VorbisDecoderPlugin.cxx b/src/decoder/plugins/VorbisDecoderPlugin.cxx index 8348407d6..e0d3d1374 100644 --- a/src/decoder/plugins/VorbisDecoderPlugin.cxx +++ b/src/decoder/plugins/VorbisDecoderPlugin.cxx @@ -347,8 +347,10 @@ vorbis_scan_stream(InputStream &is, if (!vorbis_is_open(&vis, &vf)) return false; - tag_handler_invoke_duration(handler, handler_ctx, - (int)(ov_time_total(&vf, -1) + 0.5)); + const auto total = ov_time_total(&vf, -1); + if (total >= 0) + tag_handler_invoke_duration(handler, handler_ctx, + SongTime::FromS(total)); vorbis_comments_scan(ov_comment(&vf, -1)->user_comments, handler, handler_ctx); |