aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/DsdiffDecoderPlugin.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/DsdiffDecoderPlugin.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/DsdiffDecoderPlugin.cxx5
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 */