From 3158955198fbdc71319cd3418523d851e6d47106 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2014 22:43:36 +0200 Subject: TagHandler: pass SongTime to duration() --- src/decoder/plugins/SndfileDecoderPlugin.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/decoder/plugins/SndfileDecoderPlugin.cxx') diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index 78897da58..558101089 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -246,8 +246,9 @@ sndfile_scan_stream(InputStream &is, return false; } - tag_handler_invoke_duration(handler, handler_ctx, - info.frames / info.samplerate); + const auto duration = + SongTime::FromScale(info.frames, info.samplerate); + tag_handler_invoke_duration(handler, handler_ctx, duration); for (auto i : sndfile_tags) sndfile_handle_tag(sf, i.str, i.tag, handler, handler_ctx); -- cgit v1.2.3