avcodec/vaapi_encode: respect -force_key_frames setting
authorAman Gupta <aman@tmm1.net>
Wed, 7 Aug 2019 17:20:51 +0000 (10:20 -0700)
committerAman Gupta <aman@tmm1.net>
Mon, 26 Aug 2019 23:09:11 +0000 (16:09 -0700)
This was a regression in 5fdcf85bbffe7451c227478fda62da5c0938f27d

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
libavcodec/vaapi_encode.c

index e69b59f..2fb43cf 100644 (file)
@@ -1057,7 +1057,7 @@ int ff_vaapi_encode_send_frame(AVCodecContext *avctx, const AVFrame *frame)
         if (err < 0)
             goto fail;
 
-        if (ctx->input_order == 0)
+        if (ctx->input_order == 0 || frame->pict_type == AV_PICTURE_TYPE_I)
             pic->force_idr = 1;
 
         pic->input_surface = (VASurfaceID)(uintptr_t)frame->data[3];