[vlc-devel] commit: Fix latest crash in modules/codec/x264.c with ratecontrol. ( Jean-Paul Saman )

git version control git at videolan.org
Thu Apr 24 19:14:49 CEST 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Sat Apr 19 14:20:02 2008 +0200| [d57808678b916edd39eb57eaa328c0af426799b7]

Fix latest crash in modules/codec/x264.c with ratecontrol.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d57808678b916edd39eb57eaa328c0af426799b7
---

 modules/codec/x264.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 01fcfc5..97ec210 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -782,14 +782,6 @@ static int  Open ( vlc_object_t *p_this )
     /* average bitrate specified by transcode vb */
     p_sys->param.rc.i_bitrate = p_enc->fmt_out.i_bitrate / 1000;
 
-#if X264_BUILD < 48
-    /* cbr = 1 overrides qp or crf and sets an average bitrate
-       but maxrate = average bitrate is needed for "real" CBR */
-    if( p_sys->param.rc.i_bitrate > 0 ) p_sys->param.rc.b_cbr = 1;
-#else
-    if( p_sys->param.rc.i_bitrate > 0 ) p_sys->param.rc.i_rc_method = X264_RC_ABR;
-#endif
-
     var_Get( p_enc, SOUT_CFG_PREFIX "qpstep", &val );
     if( val.i_int >= 0 && val.i_int <= 51 ) p_sys->param.rc.i_qp_step = val.i_int;
     var_Get( p_enc, SOUT_CFG_PREFIX "qpmin", &val );
@@ -821,6 +813,14 @@ static int  Open ( vlc_object_t *p_this )
 #endif
     }
 
+#if X264_BUILD < 48
+    /* cbr = 1 overrides qp or crf and sets an average bitrate
+       but maxrate = average bitrate is needed for "real" CBR */
+    if( p_sys->param.rc.i_bitrate > 0 ) p_sys->param.rc.b_cbr = 1;
+#else
+    if( p_sys->param.rc.i_bitrate > 0 ) p_sys->param.rc.i_rc_method = X264_RC_ABR;
+#endif
+
 #if X264_BUILD >= 24
     var_Get( p_enc, SOUT_CFG_PREFIX "ratetol", &val );
     p_sys->param.rc.f_rate_tolerance = val.f_float;




More information about the vlc-devel mailing list