[FFmpeg-devel,16/20] vaapi_h264: Fix CPB/DPB delays

Submitted by Mark Thompson on Oct. 8, 2017, 8:01 p.m.

Details

Message ID 20171008200154.4873-17-sw@jkqxz.net
State New
Headers show

Commit Message

Mark Thompson Oct. 8, 2017, 8:01 p.m.
This should be ticks, not time_scale steps - it was wrong for all
framerates not a multiple of 1/2.

(cherry picked from commit 30645174e333c7db1946ab09be769db9be9d7481)
---
 libavcodec/vaapi_encode_h264.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 8ca82df084..d87485d5f0 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -616,10 +616,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;
     }