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/DsdiffDecoderPlugin.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/decoder/plugins/DsdiffDecoderPlugin.cxx') diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 112de8b90..617d34ae4 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -437,8 +437,10 @@ dsdiff_stream_decode(Decoder &decoder, InputStream &is) /* calculate song time from DSD chunk size and sample frequency */ offset_type chunk_size = metadata.chunk_size; - float songtime = ((chunk_size / metadata.channels) * 8) / - (float) metadata.sample_rate; + + uint64_t n_frames = chunk_size / audio_format.channels; + auto songtime = SongTime::FromScale(n_frames, + audio_format.sample_rate); /* success: file was recognized */ decoder_initialized(decoder, audio_format, is.IsSeekable(), songtime); -- cgit v1.2.3