From e35c984a5d5702d2762e970f69bfb1f1265db579 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 14 Dec 2010 14:52:37 +0000 Subject: [PATCH] Move setting of bitstream_id and bitstream_mode to ac3_encode_init(). Originally committed as revision 25983 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ac3enc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index e7fdae2ef8..6adc11f83c 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1277,8 +1277,6 @@ static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s) s->sample_rate = avctx->sample_rate; s->bit_alloc.sr_shift = i % 3; s->bit_alloc.sr_code = i / 3; - s->bitstream_id = 8 + s->bit_alloc.sr_shift; - s->bitstream_mode = 0; /* complete main audio service */ /* bitrate & frame size */ for (i = 0; i < 19; i++) { @@ -1312,6 +1310,9 @@ static av_cold int ac3_encode_init(AVCodecContext *avctx) if (ret) return ret; + s->bitstream_id = 8 + s->bit_alloc.sr_shift; + s->bitstream_mode = 0; /* complete main audio service */ + s->frame_size_min = 2 * ff_ac3_frame_size_tab[s->frame_size_code][s->bit_alloc.sr_code]; s->bits_written = 0; s->samples_written = 0;