From 05036ef6182568bdcc0811be727d3b9e8024d07e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Aug 2005 10:05:57 +0000 Subject: Fix musepack bitrate display Thanks to Paul Seropian (paranoos) git-svn-id: https://svn.musicpd.org/mpd/trunk@3421 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/mpc_plugin.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/inputPlugins') 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, -- cgit v1.2.3