summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-09-08 12:45:05 +0200
committerMax Kellermann <max@musicpd.org>2019-09-08 12:45:05 +0200
commit0da9c91af263706009c99086059cd3eec8de62d2 (patch)
tree61f83532fe938c5a566a1f115fc6ac4227759b48
parent193e637dd9516d0c1d2236ace511eba8971d30ef (diff)
decoder/{dsf,dsdiff}: fix displayed bit rate
The formula did not consider the channel count. Closes https://github.com/MusicPlayerDaemon/MPD/issues/639
-rw-r--r--NEWS2
-rw-r--r--src/decoder/plugins/DsdiffDecoderPlugin.cxx2
-rw-r--r--src/decoder/plugins/DsfDecoderPlugin.cxx2
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;
}