aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schmidt <schmidt@digadd.de>2012-10-16 15:40:58 +0200
committerLuca Barbato <lu_zero@gentoo.org>2012-10-16 16:03:03 +0200
commit4a7429203a390f5629c819b98f314246b62b2145 (patch)
tree49042e590907bfbdfd272d3ed7e784f5a7f58dae
parent9a978b334b9b905c3bd4f858b9479c415ce61f51 (diff)
downloadffmpeg-4a7429203a390f5629c819b98f314246b62b2145.tar.gz
pcm-mpeg: correct bitrate calculation
Bitrate calculation is off since the bluray spec always specifies an even number of coded channels. This was honored in the decoder, but not for bitrate calculation. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/pcm-mpeg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c
index 4a386483d1..b5af6493b7 100644
--- a/libavcodec/pcm-mpeg.c
+++ b/libavcodec/pcm-mpeg.c
@@ -109,12 +109,12 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
return -1;
}
- avctx->bit_rate = avctx->channels * avctx->sample_rate *
+ avctx->bit_rate = FFALIGN(avctx->channels, 2) * avctx->sample_rate *
avctx->bits_per_coded_sample;
if (avctx->debug & FF_DEBUG_PICT_INFO)
av_dlog(avctx,
- "pcm_bluray_parse_header: %d channels, %d bits per sample, %d kHz, %d kbit\n",
+ "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
avctx->channels, avctx->bits_per_coded_sample,
avctx->sample_rate, avctx->bit_rate);
return 0;