1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '0940b748bdba36c4894fc8ea6be631d821fdf578'

* commit '0940b748bdba36c4894fc8ea6be631d821fdf578':
  qsvdec: Only warn about unconsumed data if it happens more than once

Merged-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2017-03-31 17:14:10 -03:00
commit 4fe9d69648
2 changed files with 6 additions and 1 deletions

View File

@ -330,8 +330,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) {

View File

@ -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;