[FFmpeg-devel] avcodec/vaapi_encode: respect -force_key_frames setting

Submitted by Aman Gupta on Aug. 7, 2019, 5:26 p.m.

Details

Message ID 20190807172633.11150-1-ffmpeg@tmm1.net
State Accepted
Commit 0821bc4eee25909736efe90616e8afca942c00d5
Headers show

Commit Message

Aman Gupta Aug. 7, 2019, 5:26 p.m.
From: Aman Gupta <aman@tmm1.net>

Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 libavcodec/vaapi_encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index e69b59fa37..2fb43cf1a4 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -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];