diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/DsdiffDecoderPlugin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 617d34ae4..b6c79e11e 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -474,8 +474,9 @@ dsdiff_scan_stream(InputStream &is, return false; /* calculate song time and add as tag */ - unsigned songtime = ((metadata.chunk_size / metadata.channels) * 8) / - metadata.sample_rate; + uint64_t n_frames = metadata.chunk_size / audio_format.channels; + auto songtime = SongTime::FromScale<uint64_t>(n_frames, + audio_format.sample_rate); tag_handler_invoke_duration(handler, handler_ctx, songtime); /* Read additional metadata and created tags if available */ |