aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/plugins/MpcdecDecoderPlugin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder/plugins/MpcdecDecoderPlugin.cxx')
-rw-r--r--src/decoder/plugins/MpcdecDecoderPlugin.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/decoder/plugins/MpcdecDecoderPlugin.cxx b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
index 391b5d691..e1ddd05f0 100644
--- a/src/decoder/plugins/MpcdecDecoderPlugin.cxx
+++ b/src/decoder/plugins/MpcdecDecoderPlugin.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2014 The Music Player Daemon Project
+ * Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -134,8 +134,6 @@ mpc_to_mpd_buffer(MpcdecSampleTraits::pointer_type dest,
static void
mpcdec_decode(Decoder &mpd_decoder, InputStream &is)
{
- MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
-
mpc_decoder_data data(is, &mpd_decoder);
mpc_reader reader;
@@ -195,8 +193,7 @@ mpcdec_decode(Decoder &mpd_decoder, InputStream &is)
decoder_seek_error(mpd_decoder);
}
- mpc_uint32_t vbr_update_bits = 0;
-
+ MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH];
mpc_frame_info frame;
frame.buffer = (MPC_SAMPLE_FORMAT *)sample_buffer;
mpc_status status = mpc_demux_decode(demux, &frame);
@@ -215,8 +212,8 @@ mpcdec_decode(Decoder &mpd_decoder, InputStream &is)
MpcdecSampleTraits::value_type chunk[ARRAY_SIZE(sample_buffer)];
mpc_to_mpd_buffer(chunk, sample_buffer, ret);
- long bit_rate = vbr_update_bits * audio_format.sample_rate
- / 1152 / 1000;
+ long bit_rate = unsigned(frame.bits) * audio_format.sample_rate
+ / (1000 * frame.samples);
cmd = decoder_data(mpd_decoder, is,
chunk, ret * sizeof(chunk[0]),