Skip to content

Commit d9751a1

Browse files
committed
avcodec/h264_ps: Show VUI and SPS overread messages just once per frame thread
Signed-off-by: Michael Niedermayer <[email protected]>
1 parent 3182114 commit d9751a1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libavcodec/h264_ps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
579579
}
580580

581581
if (get_bits_left(gb) < 0) {
582-
av_log(avctx, ignore_truncation ? AV_LOG_WARNING : AV_LOG_ERROR,
582+
av_log_once(avctx, ignore_truncation ? AV_LOG_WARNING : AV_LOG_ERROR, AV_LOG_DEBUG,
583+
&ps->overread_warning_printed[sps->vui_parameters_present_flag],
583584
"Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(gb));
584585
if (!ignore_truncation)
585586
goto fail;

libavcodec/h264_ps.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ typedef struct H264ParamSets {
144144
/* currently active parameters sets */
145145
const PPS *pps;
146146
const SPS *sps;
147+
148+
int overread_warning_printed[2];
147149
} H264ParamSets;
148150

149151
/**

0 commit comments

Comments
 (0)