From: "Chen,Wenbin" <[email protected]>

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 be error. Conditional
statements are added to skip these frame until reading a key frame.

Signed-off-by: Wenbin Chen <[email protected]>
---
 libavcodec/qsvdec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index d10f90a0db..8133406085 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -616,6 +616,13 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext 
*q,
     }
 
     if (!q->initialized) {
+        
+        /*  skip non-key frame when decoder is reinitialized. 
+        Adding before will skip all the non-key frames so add 
+        it here */
+        if (ret < 0)
+            return ret;
+
         ret = qsv_decode_init_context(avctx, q, &param);
         if (ret < 0)
             goto reinit_fail;
-- 
2.25.1

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to