aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-01-14 05:32:38 +0100
committerLuca Barbato <lu_zero@gentoo.org>2013-01-15 09:12:41 +0100
commite44d56b18d46957fceaefe7f8840263c5cd12d37 (patch)
tree03dd8c9810abe3ff7bc46c3d1c7ca73e64e83cda /libavcodec
parent71e00caeab89d9beeef9c947673f72e992bd109c (diff)
downloadffmpeg-e44d56b18d46957fceaefe7f8840263c5cd12d37.tar.gz
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 bff3607547fdbb6e32b3830a351e6a33280c1e0d) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 23f2ac481a..19c8a99ff5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -824,6 +824,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
} 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)) {