summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-10-30 16:58:23 +0000
committerMark Thompson <sw@jkqxz.net>2016-11-14 19:38:19 +0000
commit0940b748bdba36c4894fc8ea6be631d821fdf578 (patch)
tree302dab32d83e7d85a4cfdd9858b56365988b8352 /libavcodec
parent030d84fa2e35af0e77516735de35bf1a52371c86 (diff)
qsvdec: Only warn about unconsumed data if it happens more than once
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/qsvdec.c6
-rw-r--r--libavcodec/qsvdec.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index d61ec7d0aa..9e5b1b345d 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -328,8 +328,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 d807864aa5..c6ec99af15 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;