From ae8ee8781c1ca68f39a556333d84b5e7e417472f Mon Sep 17 00:00:00 2001
From: "Chen,Wenbin" <wenbin.chen@intel.com>
Date: Mon, 8 Feb 2021 13:05:55 +0800
Subject: [PATCH] libavcodec/qsvdec: skip non-key frame after "seek" function
Fix #9095. Qsv decoder assume that after calling seek funcion, the first
frame should be key frame. However this is not true for some videos. If
the frame is not key frame after seek(), there will error. Conditional
statements are added to skip these frame until reading a key frame.
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
---
libavcodec/qsvdec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index d10f90a0db..5267d3009e 100644
|
a
|
b
|
int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | if (!q->initialized) { |
| | 619 | if (ret < 0) |
| | 620 | return ret; |
| 619 | 621 | ret = qsv_decode_init_context(avctx, q, ¶m); |
| 620 | 622 | if (ret < 0) |
| 621 | 623 | goto reinit_fail; |