aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/WavpackDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-29 22:43:36 +0200
committerMax Kellermann <max@duempel.org>2014-08-29 22:52:04 +0200
commit3158955198fbdc71319cd3418523d851e6d47106 (patch)
treeab3fff73fe7efa73ed95f9998eec5da66947b4e2 /src/decoder/plugins/WavpackDecoderPlugin.cxx
parentd9d97bd17bf0d9469dcf00120d3d3fdab87299bc (diff)
downloadmpd-3158955198fbdc71319cd3418523d851e6d47106.tar.gz
mpd-3158955198fbdc71319cd3418523d851e6d47106.tar.xz
mpd-3158955198fbdc71319cd3418523d851e6d47106.zip
TagHandler: pass SongTime to duration()
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 */