summaryrefslogtreecommitdiff
path: root/libavcodec/pcm.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-05-16 00:01:34 +0100
committerMans Rullgard <mans@mansr.com>2012-05-17 02:34:57 +0100
commit7d7b40f48a05af4483b31cdb8b4f1808b97b1f2f (patch)
tree205b3b9042d680cc90345fda1b90be4da4ddf609 /libavcodec/pcm.c
parentd894752387fe0d79afb752d1437ca4e98a47cf9f (diff)
pcmenc: set correct bitrate value
This fixes a bogus bitrate value in the header of WAV files with alaw/ulaw audio. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r--libavcodec/pcm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 9614e8c3c8..5f43f9b685 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -48,6 +48,7 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8;
+ avctx->bit_rate = avctx->block_align * avctx->sample_rate * 8;
avctx->coded_frame = avcodec_alloc_frame();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);