aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mpc_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2005-08-07 10:05:57 +0000
committerEric Wong <normalperson@yhbt.net>2005-08-07 10:05:57 +0000
commit05036ef6182568bdcc0811be727d3b9e8024d07e (patch)
tree2b4f0e2f7f9e252e1af48a8bf7d555d83a15e5c9 /src/inputPlugins/mpc_plugin.c
parentef444e6cbe3960af5f7253fea72c14bc60eb66c4 (diff)
downloadmpd-05036ef6182568bdcc0811be727d3b9e8024d07e.tar.gz
mpd-05036ef6182568bdcc0811be727d3b9e8024d07e.tar.xz
mpd-05036ef6182568bdcc0811be727d3b9e8024d07e.zip
Fix musepack bitrate display
Thanks to Paul Seropian (paranoos) git-svn-id: https://svn.musicpd.org/mpd/trunk@3421 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/mpc_plugin.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c
index 5e5cd3cfa..af332dbf4 100644
--- a/src/inputPlugins/mpc_plugin.c
+++ b/src/inputPlugins/mpc_plugin.c
@@ -201,6 +201,8 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
dc->seek = 0;
}
+ vbrUpdateAcc = 0;
+ vbrUpdateBits = 0;
ret = mpc_decoder_decode(&decoder, sample_buffer,
&vbrUpdateAcc, &vbrUpdateBits);
@@ -226,7 +228,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
bitRate = vbrUpdateBits *
dc->audioFormat.sampleRate /
- (MPC_CHUNK_SIZE);
+ 1152 / 1000;
sendDataToOutputBuffer(cb, inStream, dc,
inStream->seekable,
@@ -248,8 +250,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc,
if(!dc->stop && chunkpos > 0) {
time = ((float)samplePos) / dc->audioFormat.sampleRate;
- bitRate = vbrUpdateBits * dc->audioFormat.sampleRate /
- chunkpos;
+ bitRate = vbrUpdateBits * dc->audioFormat.sampleRate / 1152 / 1000;
sendDataToOutputBuffer(cb, NULL, dc, inStream->seekable,
chunk, chunkpos, time, bitRate,