From 0da9c91af263706009c99086059cd3eec8de62d2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 8 Sep 2019 12:45:05 +0200 Subject: [PATCH] decoder/{dsf,dsdiff}: fix displayed bit rate The formula did not consider the channel count. Closes https://github.com/MusicPlayerDaemon/MPD/issues/639 --- NEWS | 2 ++ src/decoder/plugins/DsdiffDecoderPlugin.cxx | 2 +- src/decoder/plugins/DsfDecoderPlugin.cxx | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bfbd0acbe..48489ab41 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.21.15 (not yet released) +* decoder + - dsdiff, dsf: fix displayed bit rate ver 0.21.14 (2019/08/21) * decoder diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index e601c6ebd..8c76227eb 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -408,7 +408,7 @@ dsdiff_decode_chunk(DecoderClient &client, InputStream &is, bit_reverse_buffer(buffer, buffer + nbytes); cmd = client.SubmitData(is, buffer, nbytes, - sample_rate / 1000); + channels * sample_rate / 1000); } return true; diff --git a/src/decoder/plugins/DsfDecoderPlugin.cxx b/src/decoder/plugins/DsfDecoderPlugin.cxx index e040d449c..a019ee5c3 100644 --- a/src/decoder/plugins/DsfDecoderPlugin.cxx +++ b/src/decoder/plugins/DsfDecoderPlugin.cxx @@ -291,7 +291,7 @@ dsf_decode_chunk(DecoderClient &client, InputStream &is, cmd = client.SubmitData(is, interleaved_buffer, block_size, - sample_rate / 1000); + channels * sample_rate / 1000); ++i; }