diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 5f6ea5ae6c..d6adcdc335 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -330,8 +330,12 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, /* make sure we do not enter an infinite loop if the SDK * did not consume any data and did not return anything */ if (!*sync && !bs.DataOffset) { - ff_qsv_print_warning(avctx, ret, "A decode call did not consume any data"); bs.DataOffset = avpkt->size; + ++q->zero_consume_run; + if (q->zero_consume_run > 1) + ff_qsv_print_warning(avctx, ret, "A decode call did not consume any data"); + } else { + q->zero_consume_run = 0; } if (*sync) { diff --git a/libavcodec/qsvdec.h b/libavcodec/qsvdec.h index 41fb71682c..4e86e4b7f8 100644 --- a/libavcodec/qsvdec.h +++ b/libavcodec/qsvdec.h @@ -51,6 +51,7 @@ typedef struct QSVContext { QSVFrame *work_frames; AVFifoBuffer *async_fifo; + int zero_consume_run; // the internal parser and codec context for parsing the data AVCodecParserContext *parser;