aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/DsfDecoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx
index c92c276fc..b84eadf66 100644
--- a/src/decoder/plugins/DsfDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsfDecoderPlugin.cxx
@@ -318,8 +318,8 @@ dsf_stream_decode(Decoder &decoder, InputStream &is)
}
/* Calculate song time from DSD chunk size and sample frequency */
const auto n_blocks = metadata.n_blocks;
- float songtime = float(n_blocks * DSF_BLOCK_BITS) /
- (float) metadata.sample_rate;
+ auto songtime = SongTime::FromScale<uint64_t>(n_blocks * DSF_BLOCK_SIZE,
+ audio_format.sample_rate);
/* success: file was recognized */
decoder_initialized(decoder, audio_format, is.IsSeekable(), songtime);