[FFmpeg-cvslog] lavc/qsvdec: return 0 if more data is required
Haihao Xiang
git at videolan.org
Fri Dec 29 07:25:27 EET 2023
ffmpeg | branch: release/6.1 | Haihao Xiang <haihao.xiang at intel.com> | Mon Nov 27 14:01:50 2023 +0800| [d596225a57f1d49f3f1931a073de6e548b9440d9] | committer: Haihao Xiang
lavc/qsvdec: return 0 if more data is required
The type of qsv decoders is FF_CODEC_CB_TYPE_DECODE which must not
return AVERROR(EAGAIN). commit 42b20c9 added an assertion to check the
returned value.
Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>
(cherry picked from commit e233f3e75fda8dd60a3dc5f55b7a4bd32b238b6a)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d596225a57f1d49f3f1931a073de6e548b9440d9
---
libavcodec/qsvdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index da700f25e9..b501964089 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -1076,6 +1076,9 @@ static int qsv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
ret = qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->buffer_pkt);
if (ret < 0){
+ if (ret == AVERROR(EAGAIN))
+ ret = 0;
+
/* Drop buffer_pkt when failed to decode the packet. Otherwise,
the decoder will keep decoding the failure packet. */
av_packet_unref(&s->buffer_pkt);
More information about the ffmpeg-cvslog
mailing list