diff options
author | Jurgen Kramer <gtmkramer@xs4all.nl> | 2014-04-04 12:43:54 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-16 18:38:44 +0200 |
commit | 7c3af4f56f7171aacbe9bd26f2b30bb4f94e88f2 (patch) | |
tree | b6c4fc5c4782b9c939f08baf6c53c478eeda015c /src/decoder | |
parent | 880ce080b75260fa19ec3bcbbb5b215f71823684 (diff) | |
download | mpd-7c3af4f56f7171aacbe9bd26f2b30bb4f94e88f2.tar.gz mpd-7c3af4f56f7171aacbe9bd26f2b30bb4f94e88f2.tar.xz mpd-7c3af4f56f7171aacbe9bd26f2b30bb4f94e88f2.zip |
Report bitrate for DSF and DSDIFF DSD decoders
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/plugins/DsdiffDecoderPlugin.cxx | 6 | ||||
-rw-r--r-- | src/decoder/plugins/DsfDecoderPlugin.cxx | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index c6880c4f9..4ea2bb97c 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -355,7 +355,7 @@ bit_reverse_buffer(uint8_t *p, uint8_t *end) */ static bool dsdiff_decode_chunk(Decoder &decoder, InputStream &is, - unsigned channels, + unsigned channels, unsigned sample_rate, uint64_t chunk_size) { uint8_t buffer[8192]; @@ -385,7 +385,8 @@ dsdiff_decode_chunk(Decoder &decoder, InputStream &is, if (lsbitfirst) bit_reverse_buffer(buffer, buffer + nbytes); - const auto cmd = decoder_data(decoder, is, buffer, nbytes, 0); + const auto cmd = decoder_data(decoder, is, buffer, nbytes, + sample_rate / 1000); switch (cmd) { case DecoderCommand::NONE: break; @@ -440,6 +441,7 @@ dsdiff_stream_decode(Decoder &decoder, InputStream &is) if (chunk_header.id.Equals("DSD ")) { if (!dsdiff_decode_chunk(decoder, is, metadata.channels, + metadata.sample_rate, chunk_size)) break; } else { diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx index 884ff1b3c..dc94d149c 100644 --- a/src/decoder/plugins/DsfDecoderPlugin.cxx +++ b/src/decoder/plugins/DsfDecoderPlugin.cxx @@ -219,7 +219,7 @@ dsf_to_pcm_order(uint8_t *dest, uint8_t *scratch, size_t nrbytes) */ static bool dsf_decode_chunk(Decoder &decoder, InputStream &is, - unsigned channels, + unsigned channels, unsigned sample_rate, uint64_t chunk_size, bool bitreverse) { @@ -256,7 +256,8 @@ dsf_decode_chunk(Decoder &decoder, InputStream &is, dsf_to_pcm_order(buffer, dsf_scratch_buffer, nbytes); - const auto cmd = decoder_data(decoder, is, buffer, nbytes, 0); + const auto cmd = decoder_data(decoder, is, buffer, nbytes, + sample_rate / 1000); switch (cmd) { case DecoderCommand::NONE: break; @@ -300,6 +301,7 @@ dsf_stream_decode(Decoder &decoder, InputStream &is) decoder_initialized(decoder, audio_format, false, songtime); if (!dsf_decode_chunk(decoder, is, metadata.channels, + metadata.sample_rate, chunk_size, metadata.bitreverse)) return; |