vaapi_h264: Fix CPB/DPB delays
authorMark Thompson <sw@jkqxz.net>
Sat, 9 Sep 2017 21:49:14 +0000 (22:49 +0100)
committerMark Thompson <sw@jkqxz.net>
Tue, 12 Sep 2017 21:11:55 +0000 (22:11 +0100)
This should be ticks, not time_scale steps - it was wrong for all
framerates not a multiple of 1/2.

libavcodec/vaapi_encode_h264.c

index 271644e..1288249 100644 (file)
@@ -612,10 +612,8 @@ static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx,
     if (opt->sei & SEI_TIMING) {
         memset(&priv->pic_timing, 0, sizeof(priv->pic_timing));
 
-        priv->pic_timing.cpb_removal_delay =
-            2 * sps->vui.num_units_in_tick * priv->cpb_delay;
-        priv->pic_timing.dpb_output_delay =
-            2 * sps->vui.num_units_in_tick * priv->dpb_delay;
+        priv->pic_timing.cpb_removal_delay = 2 * priv->cpb_delay;
+        priv->pic_timing.dpb_output_delay  = 2 * priv->dpb_delay;
 
         priv->sei_needed = 1;
     }