[vlc-commits] x264: don't set block length for vfr encoding

Ilkka Ollakka git at videolan.org
Sun Apr 17 10:57:05 CEST 2016


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Apr 17 11:37:34 2016 +0300| [7f2b57acbc2f794999c3e6fe0527d9c07ce8ff56] | committer: Ilkka Ollakka

x264: don't set block length for vfr encoding

fixes #16798

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

 modules/codec/x264.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 737deb9..bdfb792 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -1590,10 +1590,14 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pict )
     else
         p_block->i_flags |= BLOCK_FLAG_TYPE_PB;
 
-    /* This isn't really valid for streams with B-frames */
-    p_block->i_length = CLOCK_FREQ *
-        p_enc->fmt_in.video.i_frame_rate_base /
-            p_enc->fmt_in.video.i_frame_rate;
+    /* If we happen to have vfr stream, don't set length at all */
+    if( !p_sys->param.b_vfr_input )
+    {
+        /* This isn't really valid for streams with B-frames */
+        p_block->i_length = CLOCK_FREQ *
+            p_enc->fmt_in.video.i_frame_rate_base /
+                p_enc->fmt_in.video.i_frame_rate;
+    }
 
     /* scale pts-values back*/
     p_block->i_pts = pic.i_pts;



More information about the vlc-commits mailing list