lavc: set the default rc_initial_buffer_occupancy
rc_buffer_size is not set before.
Solve the initial the rate control underflow issue reported in
bug 222.
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit bff3607547
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
@@ -810,6 +810,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
|
||||
} else if (avctx->channel_layout) {
|
||||
avctx->channels = av_get_channel_layout_nb_channels(avctx->channel_layout);
|
||||
}
|
||||
|
||||
if (!avctx->rc_initial_buffer_occupancy)
|
||||
avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
|
||||
}
|
||||
|
||||
if(avctx->codec->init && !(avctx->active_thread_type&FF_THREAD_FRAME)){
|
||||
|
Reference in New Issue
Block a user