[FFmpeg-cvslog] qsvdec: Only warn about unconsumed data if it happens more than once

Mark Thompson git at videolan.org
Fri Mar 31 23:27:23 EEST 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Oct 30 16:58:23 2016 +0000| [0940b748bdba36c4894fc8ea6be631d821fdf578] | committer: Mark Thompson

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0940b748bdba36c4894fc8ea6be631d821fdf578
---

 libavcodec/qsvdec.c | 6 +++++-
 libavcodec/qsvdec.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index d61ec7d..9e5b1b3 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 d807864..c6ec99a 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;



More information about the ffmpeg-cvslog mailing list