diff options
author | Max Kellermann <max@duempel.org> | 2014-08-29 20:52:39 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-29 21:40:15 +0200 |
commit | d9d97bd17bf0d9469dcf00120d3d3fdab87299bc (patch) | |
tree | d7abd9d0cbc6e417aaf4427740bf47207f47d7fa /src/decoder/plugins/DsdiffDecoderPlugin.cxx | |
parent | 94f6380d693b8bece655885d37495a3a73c78b62 (diff) | |
download | mpd-d9d97bd17bf0d9469dcf00120d3d3fdab87299bc.tar.gz mpd-d9d97bd17bf0d9469dcf00120d3d3fdab87299bc.tar.xz mpd-d9d97bd17bf0d9469dcf00120d3d3fdab87299bc.zip |
DecoderAPI: pass SignedSongTime to decoder_initialized()
Diffstat (limited to '')
-rw-r--r-- | src/decoder/plugins/DsdiffDecoderPlugin.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 112de8b90..617d34ae4 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -437,8 +437,10 @@ dsdiff_stream_decode(Decoder &decoder, InputStream &is) /* calculate song time from DSD chunk size and sample frequency */ offset_type chunk_size = metadata.chunk_size; - float songtime = ((chunk_size / metadata.channels) * 8) / - (float) metadata.sample_rate; + + uint64_t n_frames = chunk_size / audio_format.channels; + auto songtime = SongTime::FromScale<uint64_t>(n_frames, + audio_format.sample_rate); /* success: file was recognized */ decoder_initialized(decoder, audio_format, is.IsSeekable(), songtime); |