From d9d97bd17bf0d9469dcf00120d3d3fdab87299bc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 29 Aug 2014 20:52:39 +0200 Subject: DecoderAPI: pass SignedSongTime to decoder_initialized() --- src/decoder/plugins/Mpg123DecoderPlugin.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/decoder/plugins/Mpg123DecoderPlugin.cxx') diff --git a/src/decoder/plugins/Mpg123DecoderPlugin.cxx b/src/decoder/plugins/Mpg123DecoderPlugin.cxx index 8779a6568..798cc953d 100644 --- a/src/decoder/plugins/Mpg123DecoderPlugin.cxx +++ b/src/decoder/plugins/Mpg123DecoderPlugin.cxx @@ -131,9 +131,11 @@ mpd_mpg123_file_decode(Decoder &decoder, Path path_fs) /* tell MPD core we're ready */ - decoder_initialized(decoder, audio_format, true, - (float)num_samples / - (float)audio_format.sample_rate); + const auto duration = + SongTime::FromScale(num_samples, + audio_format.sample_rate); + + decoder_initialized(decoder, audio_format, true, duration); if (mpg123_info(handle, &info) != MPG123_OK) { info.vbr = MPG123_CBR; -- cgit v1.2.3