Commit 0940b748 authored by Mark Thompson's avatar Mark Thompson

qsvdec: Only warn about unconsumed data if it happens more than once

parent 030d84fa
...@@ -328,8 +328,12 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, ...@@ -328,8 +328,12 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
/* make sure we do not enter an infinite loop if the SDK /* make sure we do not enter an infinite loop if the SDK
* did not consume any data and did not return anything */ * did not consume any data and did not return anything */
if (!*sync && !bs.DataOffset) { if (!*sync && !bs.DataOffset) {
ff_qsv_print_warning(avctx, ret, "A decode call did not consume any data");
bs.DataOffset = avpkt->size; 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) { if (*sync) {
......
...@@ -51,6 +51,7 @@ typedef struct QSVContext { ...@@ -51,6 +51,7 @@ typedef struct QSVContext {
QSVFrame *work_frames; QSVFrame *work_frames;
AVFifoBuffer *async_fifo; AVFifoBuffer *async_fifo;
int zero_consume_run;
// the internal parser and codec context for parsing the data // the internal parser and codec context for parsing the data
AVCodecParserContext *parser; AVCodecParserContext *parser;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment