aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qsvdec.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2023-11-27 14:01:50 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2023-12-05 10:10:57 +0800
commite233f3e75fda8dd60a3dc5f55b7a4bd32b238b6a (patch)
tree1dd82f26fa8bfd6a0dfac19ee80baa662a496e07 /libavcodec/qsvdec.c
parent5717fbbea262a028bcfa751e6c0e6798284dfade (diff)
downloadffmpeg-e233f3e75fda8dd60a3dc5f55b7a4bd32b238b6a.tar.gz
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@intel.com>
Diffstat (limited to 'libavcodec/qsvdec.c')
-rw-r--r--libavcodec/qsvdec.c3
1 files changed, 3 insertions, 0 deletions
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);