[FFmpeg-devel] [PATCH 1/2] avcodec/hevc_mp4toannexb_bsf: use HEVCNALUnitType instead of integer literal

Zhao Zhili quinkblack at foxmail.com
Wed Dec 27 14:49:23 EET 2023


From: Zhao Zhili <zhilizhao at tencent.com>

---
 libavcodec/hevc_mp4toannexb_bsf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c
index f9a025a36b..d91229a895 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -157,7 +157,8 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
         nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f;
 
         /* prepend extradata to IRAP frames */
-        is_irap       = nalu_type >= 16 && nalu_type <= 23;
+        is_irap = nalu_type >= HEVC_NAL_BLA_W_LP &&
+                  nalu_type <= HEVC_NAL_RSV_IRAP_VCL23;
         add_extradata = is_irap && !got_irap;
         extra_size    = add_extradata * ctx->par_out->extradata_size;
         got_irap     |= is_irap;
-- 
2.25.1



More information about the ffmpeg-devel mailing list