From c9a2506de9e906e82c4c99df759fcfc1142b24a4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 27 Jan 2021 19:06:36 +0100 Subject: get_bits: move check_marker() to mpegvideodec.h It is only used by mpegvideo-based decoders - specifically mpeg12, intelh263, ituh263, mpeg4video. --- libavcodec/mpegvideodec.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavcodec/mpegvideodec.h') diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h index 1af8ebac36..fabc1b2202 100644 --- a/libavcodec/mpegvideodec.h +++ b/libavcodec/mpegvideodec.h @@ -29,6 +29,8 @@ #define AVCODEC_MPEGVIDEODEC_H #include "libavutil/frame.h" +#include "libavutil/log.h" + #include "avcodec.h" #include "get_bits.h" #include "mpegpicture.h" @@ -67,4 +69,14 @@ static inline int mpeg_get_qscale(MpegEncContext *s) return qscale << 1; } +static inline int check_marker(void *logctx, GetBitContext *s, const char *msg) +{ + int bit = get_bits1(s); + if (!bit) + av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n", + get_bits_count(s) - 1, s->size_in_bits, msg); + + return bit; +} + #endif /* AVCODEC_MPEGVIDEODEC_H */ -- cgit v1.2.3