[FFmpeg-cvslog] avcodec/h264_ps: Show VUI and SPS overread messages just once per frame thread

Michael Niedermayer git at videolan.org
Wed Feb 12 12:15:29 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jan 16 17:51:29 2020 +0100| [d9751a116275ec0281ea7c4bd28d8d10b457e264] | committer: Michael Niedermayer

avcodec/h264_ps: Show VUI and SPS overread messages just once per frame thread

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/h264_ps.c | 3 ++-
 libavcodec/h264_ps.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index edbaa96b64..d36921e47b 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -579,7 +579,8 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
     }
 
     if (get_bits_left(gb) < 0) {
-        av_log(avctx, ignore_truncation ? AV_LOG_WARNING : AV_LOG_ERROR,
+        av_log_once(avctx, ignore_truncation ? AV_LOG_WARNING : AV_LOG_ERROR, AV_LOG_DEBUG,
+                    &ps->overread_warning_printed[sps->vui_parameters_present_flag],
                "Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(gb));
         if (!ignore_truncation)
             goto fail;
diff --git a/libavcodec/h264_ps.h b/libavcodec/h264_ps.h
index 9014326dfb..2cc1cd6254 100644
--- a/libavcodec/h264_ps.h
+++ b/libavcodec/h264_ps.h
@@ -144,6 +144,8 @@ typedef struct H264ParamSets {
     /* currently active parameters sets */
     const PPS *pps;
     const SPS *sps;
+
+    int overread_warning_printed[2];
 } H264ParamSets;
 
 /**



More information about the ffmpeg-cvslog mailing list