diff options
author | Eric Wong <normalperson@yhbt.net> | 2005-08-07 10:05:57 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2005-08-07 10:05:57 +0000 |
commit | 05036ef6182568bdcc0811be727d3b9e8024d07e (patch) | |
tree | 2b4f0e2f7f9e252e1af48a8bf7d555d83a15e5c9 /src/inputPlugins/mpc_plugin.c | |
parent | ef444e6cbe3960af5f7253fea72c14bc60eb66c4 (diff) | |
download | mpd-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 'src/inputPlugins/mpc_plugin.c')
-rw-r--r-- | src/inputPlugins/mpc_plugin.c | 7 |
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, |