aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/WavpackDecoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decoder/plugins/WavpackDecoderPlugin.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx
index 1efd49850..67859bbd2 100644
--- a/src/decoder/plugins/WavpackDecoderPlugin.cxx
+++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx
@@ -283,9 +283,10 @@ wavpack_scan_file(Path path_fs,
return false;
}
- tag_handler_invoke_duration(handler, handler_ctx,
- WavpackGetNumSamples(wpc) /
- WavpackGetSampleRate(wpc));
+ const auto duration =
+ SongTime::FromScale<uint64_t>(WavpackGetNumSamples(wpc),
+ WavpackGetSampleRate(wpc));
+ tag_handler_invoke_duration(handler, handler_ctx, duration);
/* the WavPack format implies APEv2 tags, which means we can
reuse the mapping from tag_ape.c */