[FFmpeg-devel] [PATCH] avcodec/vc1: set ticks_per_frame irrespective of FRAMERATE_FLAG

Jerome Borsboom jerome.borsboom at carpalis.nl
Tue Oct 23 15:50:17 EEST 2018


vc1_decode_frame assumes that ticks_per_frame is set to two when RFF
or RPTFRM is set. When FRAMERATE_FLAG is zero, this may not be the case
as the setting of ticks_per_frame is guarded by FRAMERATE_FLAG.

Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>
---
 libavcodec/vc1.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 3581d87b57..09433ad3e9 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -422,6 +422,9 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
     v->max_coded_width       = (get_bits(gb, 12) + 1) << 1;
     v->max_coded_height      = (get_bits(gb, 12) + 1) << 1;
     v->broadcast             = get_bits1(gb);
+    if (v->broadcast) // Pulldown may be present
+        v->s.avctx->ticks_per_frame = 2;
+
     v->interlace             = get_bits1(gb);
     v->tfcntrflag            = get_bits1(gb);
     v->finterpflag           = get_bits1(gb);
@@ -480,9 +483,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
                     v->s.avctx->framerate.num = ff_vc1_fps_nr[nr - 1] * 1000;
                 }
             }
-            if (v->broadcast) { // Pulldown may be present
-                v->s.avctx->ticks_per_frame = 2;
-            }
         }
 
         if (get_bits1(gb)) {
-- 
2.13.6




More information about the ffmpeg-devel mailing list