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/Mpg123DecoderPlugin.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/decoder/plugins/Mpg123DecoderPlugin.cxx') diff --git a/src/decoder/plugins/Mpg123DecoderPlugin.cxx b/src/decoder/plugins/Mpg123DecoderPlugin.cxx index 798cc953d..013155bf5 100644 --- a/src/decoder/plugins/Mpg123DecoderPlugin.cxx +++ b/src/decoder/plugins/Mpg123DecoderPlugin.cxx @@ -233,8 +233,11 @@ mpd_mpg123_scan_file(Path path_fs, mpg123_delete(handle); - tag_handler_invoke_duration(handler, handler_ctx, - num_samples / audio_format.sample_rate); + const auto duration = + SongTime::FromScale(num_samples, + audio_format.sample_rate); + + tag_handler_invoke_duration(handler, handler_ctx, duration); return true; } -- cgit v1.2.3