[vlc-commits] avcodec: only set min/maxrate if rc-buffer-size is set
Ilkka Ollakka
git at videolan.org
Thu Oct 25 16:41:56 CEST 2012
vlc/vlc-2.0 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Oct 24 23:58:49 2012 +0300| [88fe9f443f75fee558bd0a9c501985e4afd8bd08] | committer: Jean-Baptiste Kempf
avcodec: only set min/maxrate if rc-buffer-size is set
(cherry picked from commit 50a0ceae0ffa535512c5fd8e0952f277b1732458)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=88fe9f443f75fee558bd0a9c501985e4afd8bd08
---
modules/codec/avcodec/encoder.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 3dffd18..f1357cb 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -590,8 +590,11 @@ int OpenEncoder( vlc_object_t *p_this )
else
{
p_context->rc_qsquish = 1.0;
- p_context->rc_max_rate = p_enc->fmt_out.i_bitrate;
- p_context->rc_min_rate = p_enc->fmt_out.i_bitrate;
+ if( p_sys->i_rc_buffer_size )
+ {
+ p_context->rc_max_rate = p_enc->fmt_out.i_bitrate;
+ p_context->rc_min_rate = p_enc->fmt_out.i_bitrate;
+ }
p_context->rc_buffer_size = p_sys->i_rc_buffer_size;
/* This is from ffmpeg's ffmpeg.c : */
p_context->rc_initial_buffer_occupancy
More information about the vlc-commits
mailing list