diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 58ad62bd97..ce10d61f8a 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -503,5 +503,5 @@ const FFInputFormat ff_lavfi_demuxer = {
     .read_header    = lavfi_read_header,
     .read_packet    = lavfi_read_packet,
     .read_close     = lavfi_read_close,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
 };
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 3424791b81..516c7866bd 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -401,7 +401,7 @@ const FFInputFormat ff_fourxm_demuxer = {
     .p.name         = "4xm",
     .p.long_name    = NULL_IF_CONFIG_SMALL("4X Technologies"),
     .priv_data_size = sizeof(FourxmDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = fourxm_probe,
     .read_header    = fourxm_read_header,
     .read_packet    = fourxm_read_packet,
diff --git a/libavformat/aadec.c b/libavformat/aadec.c
index dd698d0d5d..c39fb51a8d 100644
--- a/libavformat/aadec.c
+++ b/libavformat/aadec.c
@@ -383,5 +383,5 @@ const FFInputFormat ff_aa_demuxer = {
     .read_packet    = aa_read_packet,
     .read_seek      = aa_read_seek,
     .read_close     = aa_read_close,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
 };
diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c
index 0ccd4944db..830ae5d89e 100644
--- a/libavformat/aaxdec.c
+++ b/libavformat/aaxdec.c
@@ -389,7 +389,7 @@ const FFInputFormat ff_aax_demuxer = {
     .p.extensions   = "aax",
     .p.flags        = AVFMT_GENERIC_INDEX,
     .priv_data_size = sizeof(AAXContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = aax_probe,
     .read_header    = aax_read_header,
     .read_packet    = aax_read_packet,
diff --git a/libavformat/ape.c b/libavformat/ape.c
index b3994d12fd..231064be61 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -450,7 +450,7 @@ const FFInputFormat ff_ape_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Monkey's Audio"),
     .p.extensions   = "ape,apl,mac",
     .priv_data_size = sizeof(APEContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = ape_probe,
     .read_header    = ape_read_header,
     .read_packet    = ape_read_packet,
diff --git a/libavformat/aqtitledec.c b/libavformat/aqtitledec.c
index e8e538e414..5d41a2278d 100644
--- a/libavformat/aqtitledec.c
+++ b/libavformat/aqtitledec.c
@@ -142,7 +142,7 @@ const FFInputFormat ff_aqtitle_demuxer = {
     .p.extensions   = "aqt",
     .p.priv_class   = &aqt_class,
     .priv_data_size = sizeof(AQTitleContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = aqt_probe,
     .read_header    = aqt_read_header,
     .read_packet    = aqt_read_packet,
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index a689a59689..3a8353f4d3 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -164,7 +164,7 @@ end:
 const FFInputFormat ff_ass_demuxer = {
     .p.name         = "ass",
     .p.long_name    = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .priv_data_size = sizeof(ASSContext),
     .read_probe     = ass_probe,
     .read_header    = ass_read_header,
diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c
index 3382613d54..3363003b18 100644
--- a/libavformat/av1dec.c
+++ b/libavformat/av1dec.c
@@ -289,7 +289,7 @@ const FFInputFormat ff_av1_demuxer = {
     .p.flags        = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS,
     .p.priv_class   = &av1_demuxer_class,
     .priv_data_size = sizeof(AV1DemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = annexb_probe,
     .read_header    = av1_read_header,
     .read_packet    = annexb_read_packet,
@@ -434,7 +434,7 @@ const FFInputFormat ff_obu_demuxer = {
     .p.flags        = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
     .p.priv_class   = &av1_demuxer_class,
     .priv_data_size = sizeof(AV1DemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = obu_probe,
     .read_header    = av1_read_header,
     .read_packet    = obu_read_packet,
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 985a9bf022..4635d25d9a 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -2016,7 +2016,7 @@ const FFInputFormat ff_avi_demuxer = {
     .p.extensions   = "avi",
     .p.priv_class   = &demuxer_class,
     .priv_data_size = sizeof(AVIContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = avi_probe,
     .read_header    = avi_read_header,
     .read_packet    = avi_read_packet,
diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index 5b2a59b6eb..8b0ba3af67 100644
--- a/libavformat/brstm.c
+++ b/libavformat/brstm.c
@@ -472,7 +472,7 @@ const FFInputFormat ff_brstm_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("BRSTM (Binary Revolution Stream)"),
     .p.extensions   = "brstm",
     .priv_data_size = sizeof(BRSTMDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
@@ -485,7 +485,7 @@ const FFInputFormat ff_bfstm_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("BFSTM (Binary Cafe Stream)"),
     .p.extensions   = "bfstm,bcstm",
     .priv_data_size = sizeof(BRSTMDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe_bfstm,
     .read_header    = read_header,
     .read_packet    = read_packet,
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index ac541a592f..6cb5b9ee24 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -947,7 +947,7 @@ const FFInputFormat ff_concat_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Virtual concatenation script"),
     .p.priv_class   = &concat_class,
     .priv_data_size = sizeof(ConcatContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = concat_probe,
     .read_header    = concat_read_header,
     .read_packet    = concat_read_packet,
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 2998bcfb48..63070b77be 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -2361,7 +2361,7 @@ const FFInputFormat ff_dash_demuxer = {
     .p.priv_class   = &dash_class,
     .p.flags        = AVFMT_NO_BYTE_SEEK,
     .priv_data_size = sizeof(DASHContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = dash_probe,
     .read_header    = dash_read_header,
     .read_packet    = dash_read_packet,
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 4c50eb5568..79c5ebd4ca 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -302,7 +302,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename,
 
     if (ffifmt(s->iformat)->read_header)
         if ((ret = ffifmt(s->iformat)->read_header(s)) < 0) {
-            if (ffifmt(s->iformat)->flags_internal & FF_FMT_INIT_CLEANUP)
+            if (ffifmt(s->iformat)->flags_internal & FF_INFMT_FLAG_INIT_CLEANUP)
                 goto close;
             goto fail;
         }
diff --git a/libavformat/demux.h b/libavformat/demux.h
index 48c71ab55d..9c76095662 100644
--- a/libavformat/demux.h
+++ b/libavformat/demux.h
@@ -28,6 +28,12 @@
 
 struct AVDeviceInfoList;
 
+/**
+ * For an FFInputFormat with this flag set read_close() needs to be called
+ * by the caller upon read_header() failure.
+ */
+#define FF_INFMT_FLAG_INIT_CLEANUP                             (1 << 0)
+
 typedef struct FFInputFormat {
     /**
      * The public AVInputFormat. See avformat.h for it.
@@ -45,7 +51,7 @@ typedef struct FFInputFormat {
     int priv_data_size;
 
     /**
-     * Internal flags. See FF_FMT_FLAG_* in internal.h.
+     * Internal flags. See FF_INFMT_FLAG_* above and FF_FMT_FLAG_* in internal.h.
      */
     int flags_internal;
 
diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c
index 761ac97ec6..8acbe5a1a1 100644
--- a/libavformat/dvdvideodec.c
+++ b/libavformat/dvdvideodec.c
@@ -1705,7 +1705,7 @@ const FFInputFormat ff_dvdvideo_demuxer = {
     .p.flags        = AVFMT_NOFILE | AVFMT_SHOW_IDS | AVFMT_TS_DISCONT |
                       AVFMT_NO_BYTE_SEEK | AVFMT_NOGENSEARCH | AVFMT_NOBINSEARCH,
     .priv_data_size = sizeof(DVDVideoDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_close     = dvdvideo_close,
     .read_header    = dvdvideo_read_header,
     .read_packet    = dvdvideo_read_packet
diff --git a/libavformat/evcdec.c b/libavformat/evcdec.c
index 5e565809ec..9e735fab55 100644
--- a/libavformat/evcdec.c
+++ b/libavformat/evcdec.c
@@ -212,7 +212,7 @@ const FFInputFormat ff_evc_demuxer = {
     .read_header    = evc_read_header, // annexb_read_header
     .read_packet    = evc_read_packet, // annexb_read_packet
     .read_close     = evc_read_close,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .raw_codec_id   = AV_CODEC_ID_EVC,
     .priv_data_size = sizeof(EVCDemuxContext),
 };
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 94defa9384..8702113e9f 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2602,7 +2602,7 @@ const FFInputFormat ff_hls_demuxer = {
     .p.priv_class   = &hls_class,
     .p.flags        = AVFMT_NOGENSEARCH | AVFMT_TS_DISCONT | AVFMT_NO_BYTE_SEEK,
     .priv_data_size = sizeof(HLSContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = hls_probe,
     .read_header    = hls_read_header,
     .read_packet    = hls_read_packet,
diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c
index fc1af82034..e34d13e74c 100644
--- a/libavformat/iamfdec.c
+++ b/libavformat/iamfdec.c
@@ -184,7 +184,7 @@ const FFInputFormat ff_iamf_demuxer = {
     .p.extensions   = "iamf",
     .p.flags        = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS | AVFMT_SHOW_IDS,
     .priv_data_size = sizeof(IAMFDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = iamf_probe,
     .read_header    = iamf_read_header,
     .read_packet    = iamf_read_packet,
diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index 0ec6e0b258..808c7ab795 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -222,7 +222,7 @@ const FFInputFormat ff_ico_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Microsoft Windows ICO"),
     .p.flags        = AVFMT_NOTIMESTAMPS,
     .priv_data_size = sizeof(IcoDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index b57c54bd14..4625d720ac 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -1019,7 +1019,7 @@ const FFInputFormat ff_imf_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("IMF (Interoperable Master Format)"),
     .p.flags        = AVFMT_NO_BYTE_SEEK,
     .p.priv_class   = &imf_class,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .priv_data_size = sizeof(IMFContext),
     .read_probe     = imf_probe,
     .read_header    = imf_read_header,
diff --git a/libavformat/internal.h b/libavformat/internal.h
index e5f8337130..7f3d1c0086 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -39,12 +39,6 @@
 #    define hex_dump_debug(class, buf, size) do { if (0) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size); } while(0)
 #endif
 
-/**
- * For an FFInputFormat with this flag set read_close() needs to be called
- * by the caller upon read_header() failure.
- */
-#define FF_FMT_INIT_CLEANUP                             (1 << 0)
-
 typedef struct AVCodecTag {
     enum AVCodecID id;
     unsigned int tag;
diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c
index 8b0aa312fc..f383d44deb 100644
--- a/libavformat/jacosubdec.c
+++ b/libavformat/jacosubdec.c
@@ -261,7 +261,7 @@ const FFInputFormat ff_jacosub_demuxer = {
     .p.name         = "jacosub",
     .p.long_name    = NULL_IF_CONFIG_SMALL("JACOsub subtitle format"),
     .priv_data_size = sizeof(JACOsubContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = jacosub_probe,
     .read_header    = jacosub_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/jpegxl_anim_dec.c b/libavformat/jpegxl_anim_dec.c
index f749b378b3..6af83825ea 100644
--- a/libavformat/jpegxl_anim_dec.c
+++ b/libavformat/jpegxl_anim_dec.c
@@ -200,5 +200,5 @@ const FFInputFormat ff_jpegxl_anim_demuxer = {
     .read_header    = jpegxl_anim_read_header,
     .read_packet    = jpegxl_anim_read_packet,
     .read_close     = jpegxl_anim_close,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
 };
diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 89c82483aa..41dad2392f 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -255,7 +255,7 @@ const FFInputFormat ff_jv_demuxer = {
     .p.name         = "jv",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV"),
     .priv_data_size = sizeof(JVDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = read_probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index 77eab2ea6b..4ce4449c4e 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -289,5 +289,5 @@ const FFInputFormat ff_laf_demuxer = {
     .read_packet    = laf_read_packet,
     .read_close     = laf_read_close,
     .read_seek      = laf_read_seek,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
 };
diff --git a/libavformat/libgme.c b/libavformat/libgme.c
index c2baa9c3ff..26d079c270 100644
--- a/libavformat/libgme.c
+++ b/libavformat/libgme.c
@@ -199,7 +199,7 @@ const FFInputFormat ff_libgme_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Game Music Emu demuxer"),
     .p.priv_class   = &class_gme,
     .priv_data_size = sizeof(GMEContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe_gme,
     .read_header    = read_header_gme,
     .read_packet    = read_packet_gme,
diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 1fab0f09d8..c270a60cb2 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -289,7 +289,7 @@ const FFInputFormat ff_libopenmpt_demuxer = {
     .p.extensions   = "669,amf,ams,dbm,digi,dmf,dsm,far,gdm,ice,imf,it,j2b,m15,mdl,med,mmcmp,mms,mo3,mod,mptm,mt2,mtm,nst,okt,plm,ppm,psm,pt36,ptm,s3m,sfx,sfx2,st26,stk,stm,ult,umx,wow,xm,xpk",
 #endif
     .priv_data_size = sizeof(OpenMPTContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = read_probe_openmpt,
     .read_header    = read_header_openmpt,
     .read_packet    = read_packet_openmpt,
diff --git a/libavformat/lrcdec.c b/libavformat/lrcdec.c
index 216bcc42eb..5435a65b15 100644
--- a/libavformat/lrcdec.c
+++ b/libavformat/lrcdec.c
@@ -229,7 +229,7 @@ const FFInputFormat ff_lrc_demuxer = {
     .p.name         = "lrc",
     .p.long_name    = NULL_IF_CONFIG_SMALL("LRC lyrics"),
     .priv_data_size = sizeof (LRCContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = lrc_probe,
     .read_header    = lrc_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8897fd622c..e724e50a8e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -4792,7 +4792,7 @@ const FFInputFormat ff_webm_dash_manifest_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"),
     .p.priv_class   = &webm_dash_class,
     .priv_data_size = sizeof(MatroskaDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_header    = webm_dash_manifest_read_header,
     .read_packet    = webm_dash_manifest_read_packet,
     .read_close     = matroska_read_close,
@@ -4805,7 +4805,7 @@ const FFInputFormat ff_matroska_demuxer = {
     .p.extensions   = "mkv,mk3d,mka,mks,webm",
     .p.mime_type    = "audio/webm,audio/x-matroska,video/webm,video/x-matroska",
     .priv_data_size = sizeof(MatroskaDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = matroska_probe,
     .read_header    = matroska_read_header,
     .read_packet    = matroska_read_packet,
diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c
index d20724b879..85bf93cd3b 100644
--- a/libavformat/mccdec.c
+++ b/libavformat/mccdec.c
@@ -206,7 +206,7 @@ const FFInputFormat ff_mcc_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("MacCaption"),
     .p.extensions   = "mcc",
     .priv_data_size = sizeof(MCCContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = mcc_probe,
     .read_header    = mcc_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/microdvddec.c b/libavformat/microdvddec.c
index 8660c43ef9..001f1cec15 100644
--- a/libavformat/microdvddec.c
+++ b/libavformat/microdvddec.c
@@ -204,7 +204,7 @@ const FFInputFormat ff_microdvd_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("MicroDVD subtitle format"),
     .p.priv_class   = &microdvd_class,
     .priv_data_size = sizeof(MicroDVDContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = microdvd_probe,
     .read_header    = microdvd_read_header,
     .read_packet    = microdvd_read_packet,
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
index b969a45550..e3165e3811 100644
--- a/libavformat/mlvdec.c
+++ b/libavformat/mlvdec.c
@@ -492,7 +492,7 @@ const FFInputFormat ff_mlv_demuxer = {
     .p.name         = "mlv",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Magic Lantern Video (MLV)"),
     .priv_data_size = sizeof(MlvContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
diff --git a/libavformat/moflex.c b/libavformat/moflex.c
index 44fdaf3269..85511a04be 100644
--- a/libavformat/moflex.c
+++ b/libavformat/moflex.c
@@ -383,5 +383,5 @@ const FFInputFormat ff_moflex_demuxer = {
     .read_packet    = moflex_read_packet,
     .read_seek      = moflex_read_seek,
     .read_close     = moflex_read_close,
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
 };
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8d1135270c..610b699d38 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10309,7 +10309,7 @@ const FFInputFormat ff_mov_demuxer = {
     .p.extensions   = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif,heic,heif",
     .p.flags        = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS | AVFMT_SHOW_IDS,
     .priv_data_size = sizeof(MOVContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = mov_probe,
     .read_header    = mov_read_header,
     .read_packet    = mov_read_packet,
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 8399ad7062..904a79d9a7 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -1055,7 +1055,7 @@ const FFInputFormat ff_vobsub_demuxer = {
     .p.extensions   = "idx",
     .p.priv_class   = &vobsub_demuxer_class,
     .priv_data_size = sizeof(VobSubDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = vobsub_probe,
     .read_header    = vobsub_read_header,
     .read_packet    = vobsub_read_packet,
diff --git a/libavformat/mpl2dec.c b/libavformat/mpl2dec.c
index 6c3dba2d8f..9daf51ff86 100644
--- a/libavformat/mpl2dec.c
+++ b/libavformat/mpl2dec.c
@@ -128,7 +128,7 @@ const FFInputFormat ff_mpl2_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("MPL2 subtitles"),
     .p.extensions   = "txt,mpl2",
     .priv_data_size = sizeof(MPL2Context),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = mpl2_probe,
     .read_header    = mpl2_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index b5abe296f1..a7fcdab05e 100644
--- a/libavformat/mpsubdec.c
+++ b/libavformat/mpsubdec.c
@@ -176,7 +176,7 @@ const FFInputFormat ff_mpsub_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("MPlayer subtitles"),
     .p.extensions   = "sub",
     .priv_data_size = sizeof(MPSubContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = mpsub_probe,
     .read_header    = mpsub_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 558a6c3b0a..c9af462855 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -4265,7 +4265,7 @@ const FFInputFormat ff_mxf_demuxer = {
     .p.flags        = AVFMT_SEEK_TO_PTS,
     .p.priv_class   = &demuxer_class,
     .priv_data_size = sizeof(MXFContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = mxf_probe,
     .read_header    = mxf_read_header,
     .read_packet    = mxf_read_packet,
diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index d6a39730cc..112c21fc8e 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -752,7 +752,7 @@ const FFInputFormat ff_nsv_demuxer = {
     .p.name         = "nsv",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Nullsoft Streaming Video"),
     .priv_data_size = sizeof(NSVContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = nsv_probe,
     .read_header    = nsv_read_header,
     .read_packet    = nsv_read_packet,
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 670964fab3..8c9b19eebb 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1313,7 +1313,7 @@ const FFInputFormat ff_nut_demuxer = {
     .p.extensions   = "nut",
     .p.codec_tag    = ff_nut_codec_tags,
     .priv_data_size = sizeof(NUTContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = nut_probe,
     .read_header    = nut_read_header,
     .read_packet    = nut_read_packet,
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index e473683aeb..6efcadd11c 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -966,7 +966,7 @@ const FFInputFormat ff_ogg_demuxer = {
     .p.extensions   = "ogg",
     .p.flags        = AVFMT_GENERIC_INDEX | AVFMT_TS_DISCONT | AVFMT_NOBINSEARCH,
     .priv_data_size = sizeof(struct ogg),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = ogg_probe,
     .read_header    = ogg_read_header,
     .read_packet    = ogg_read_packet,
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index f4bd6fb964..2ca3f45b4c 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -615,7 +615,7 @@ const FFInputFormat ff_oma_demuxer = {
     .p.extensions   = "oma,omg,aa3",
     .p.codec_tag    = ff_oma_codec_tags_list,
     .priv_data_size = sizeof(OMAContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = oma_read_probe,
     .read_header    = oma_read_header,
     .read_packet    = oma_read_packet,
diff --git a/libavformat/paf.c b/libavformat/paf.c
index c99acbd3e7..056cc6e786 100644
--- a/libavformat/paf.c
+++ b/libavformat/paf.c
@@ -270,7 +270,7 @@ const FFInputFormat ff_paf_demuxer = {
     .p.name         = "paf",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File"),
     .priv_data_size = sizeof(PAFDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = read_probe,
     .read_header    = read_header,
     .read_packet    = read_packet,
diff --git a/libavformat/pdvdec.c b/libavformat/pdvdec.c
index 79e09bd9d4..8ed4e20e6b 100644
--- a/libavformat/pdvdec.c
+++ b/libavformat/pdvdec.c
@@ -165,7 +165,7 @@ const FFInputFormat ff_pdv_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("PlayDate Video"),
     .p.extensions   = "pdv",
     .priv_data_size = sizeof(PDVDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = pdv_probe,
     .read_header    = pdv_read_header,
     .read_packet    = pdv_read_packet,
diff --git a/libavformat/pjsdec.c b/libavformat/pjsdec.c
index 22ddea3596..76e029b29f 100644
--- a/libavformat/pjsdec.c
+++ b/libavformat/pjsdec.c
@@ -111,7 +111,7 @@ const FFInputFormat ff_pjs_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("PJS (Phoenix Japanimation Society) subtitles"),
     .p.extensions   = "pjs",
     .priv_data_size = sizeof(PJSContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = pjs_probe,
     .read_header    = pjs_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/pp_bnk.c b/libavformat/pp_bnk.c
index d545694bef..34156dd717 100644
--- a/libavformat/pp_bnk.c
+++ b/libavformat/pp_bnk.c
@@ -320,7 +320,7 @@ const FFInputFormat ff_pp_bnk_demuxer = {
     .p.name         = "pp_bnk",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Pro Pinball Series Soundbank"),
     .priv_data_size = sizeof(PPBnkCtx),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = pp_bnk_probe,
     .read_header    = pp_bnk_read_header,
     .read_packet    = pp_bnk_read_packet,
diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c
index 713e174b92..ccf87e9375 100644
--- a/libavformat/realtextdec.c
+++ b/libavformat/realtextdec.c
@@ -137,7 +137,7 @@ const FFInputFormat ff_realtext_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("RealText subtitle format"),
     .p.extensions   = "rt",
     .priv_data_size = sizeof(RealTextContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = realtext_probe,
     .read_header    = realtext_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index ded194bddd..2e75aba2a6 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -1149,7 +1149,7 @@ const FFInputFormat ff_rm_demuxer = {
     .p.name         = "rm",
     .p.long_name    = NULL_IF_CONFIG_SMALL("RealMedia"),
     .priv_data_size = sizeof(RMDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = rm_probe,
     .read_header    = rm_read_header,
     .read_packet    = rm_read_packet,
@@ -1403,7 +1403,7 @@ const FFInputFormat ff_ivr_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("IVR (Internet Video Recording)"),
     .p.extensions   = "ivr",
     .priv_data_size = sizeof(RMDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = ivr_probe,
     .read_header    = ivr_read_header,
     .read_packet    = ivr_read_packet,
diff --git a/libavformat/samidec.c b/libavformat/samidec.c
index 4abf7789d1..39e7f4cb8b 100644
--- a/libavformat/samidec.c
+++ b/libavformat/samidec.c
@@ -127,7 +127,7 @@ const FFInputFormat ff_sami_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("SAMI subtitle format"),
     .p.extensions   = "smi,sami",
     .priv_data_size = sizeof(SAMIContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = sami_probe,
     .read_header    = sami_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
index f6d5f29a0a..ea05a24533 100644
--- a/libavformat/sccdec.c
+++ b/libavformat/sccdec.c
@@ -152,7 +152,7 @@ const FFInputFormat ff_scc_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Scenarist Closed Captions"),
     .p.extensions   = "scc",
     .priv_data_size = sizeof(SCCContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = scc_probe,
     .read_header    = scc_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/scd.c b/libavformat/scd.c
index e34d60dcfb..1eef834771 100644
--- a/libavformat/scd.c
+++ b/libavformat/scd.c
@@ -370,7 +370,7 @@ const FFInputFormat ff_scd_demuxer = {
     .p.name         = "scd",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Square Enix SCD"),
     .priv_data_size = sizeof(SCDDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = scd_probe,
     .read_header    = scd_read_header,
     .read_packet    = scd_read_packet,
diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 5cbeed6d91..f86845f35e 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -329,7 +329,7 @@ const FFInputFormat ff_segafilm_demuxer = {
     .p.name         = "film_cpk",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Sega FILM / CPK"),
     .priv_data_size = sizeof(FilmDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = film_probe,
     .read_header    = film_read_header,
     .read_packet    = film_read_packet,
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index e7cc4075de..039c6436db 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -318,7 +318,7 @@ const FFInputFormat ff_vmd_demuxer = {
     .p.name         = "vmd",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Sierra VMD"),
     .priv_data_size = sizeof(VmdDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = vmd_probe,
     .read_header    = vmd_read_header,
     .read_packet    = vmd_read_packet,
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 678796c9dd..6bf73599a7 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -218,7 +218,7 @@ const FFInputFormat ff_srt_demuxer = {
     .p.name      = "srt",
     .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
     .priv_data_size = sizeof(SRTContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe  = srt_probe,
     .read_header = srt_read_header,
     .read_packet = ff_subtitles_read_packet,
diff --git a/libavformat/stldec.c b/libavformat/stldec.c
index 3b3b113827..dee5e34a62 100644
--- a/libavformat/stldec.c
+++ b/libavformat/stldec.c
@@ -114,7 +114,7 @@ const FFInputFormat ff_stl_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Spruce subtitle format"),
     .p.extensions   = "stl",
     .priv_data_size = sizeof(STLContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = stl_probe,
     .read_header    = stl_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/subviewer1dec.c b/libavformat/subviewer1dec.c
index 5e7ed729ac..59452d16fc 100644
--- a/libavformat/subviewer1dec.c
+++ b/libavformat/subviewer1dec.c
@@ -96,7 +96,7 @@ const FFInputFormat ff_subviewer1_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("SubViewer v1 subtitle format"),
     .p.extensions   = "sub",
     .priv_data_size = sizeof(SubViewer1Context),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = subviewer1_probe,
     .read_header    = subviewer1_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/subviewerdec.c b/libavformat/subviewerdec.c
index 1d1d99afa9..a6b8014cb9 100644
--- a/libavformat/subviewerdec.c
+++ b/libavformat/subviewerdec.c
@@ -191,7 +191,7 @@ const FFInputFormat ff_subviewer_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("SubViewer subtitle format"),
     .p.extensions   = "sub",
     .priv_data_size = sizeof(SubViewerContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = subviewer_probe,
     .read_header    = subviewer_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/tedcaptionsdec.c b/libavformat/tedcaptionsdec.c
index 4dbbe5a5b1..ceb6e7f599 100644
--- a/libavformat/tedcaptionsdec.c
+++ b/libavformat/tedcaptionsdec.c
@@ -361,7 +361,7 @@ const FFInputFormat ff_tedcaptions_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("TED Talks captions"),
     .p.priv_class   = &tedcaptions_demuxer_class,
     .priv_data_size = sizeof(TEDCaptionsDemuxer),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_header    = tedcaptions_read_header,
     .read_packet    = tedcaptions_read_packet,
     .read_close     = tedcaptions_read_close,
diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c
index 9de3689720..86b1023867 100644
--- a/libavformat/tiertexseq.c
+++ b/libavformat/tiertexseq.c
@@ -312,7 +312,7 @@ const FFInputFormat ff_tiertexseq_demuxer = {
     .p.name         = "tiertexseq",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ"),
     .priv_data_size = sizeof(SeqDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = seq_probe,
     .read_header    = seq_read_header,
     .read_packet    = seq_read_packet,
diff --git a/libavformat/vapoursynth.c b/libavformat/vapoursynth.c
index e300392a8a..b5d80abf30 100644
--- a/libavformat/vapoursynth.c
+++ b/libavformat/vapoursynth.c
@@ -486,7 +486,7 @@ const FFInputFormat ff_vapoursynth_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("VapourSynth demuxer"),
     .p.priv_class   = &class_vs,
     .priv_data_size = sizeof(VSContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = probe_vs,
     .read_header    = read_header_vs,
     .read_packet    = read_packet_vs,
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 98bf134f25..ee4048415e 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -795,7 +795,7 @@ const FFInputFormat ff_vividas_demuxer = {
     .p.name         = "vividas",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Vividas VIV"),
     .priv_data_size = sizeof(VividasDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = viv_probe,
     .read_header    = viv_read_header,
     .read_packet    = viv_read_packet,
diff --git a/libavformat/vplayerdec.c b/libavformat/vplayerdec.c
index cd6b3d6c3a..a9d84470c6 100644
--- a/libavformat/vplayerdec.c
+++ b/libavformat/vplayerdec.c
@@ -101,7 +101,7 @@ const FFInputFormat ff_vplayer_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("VPlayer subtitles"),
     .p.extensions   = "txt",
     .priv_data_size = sizeof(VPlayerContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = vplayer_probe,
     .read_header    = vplayer_read_header,
     .read_packet    = ff_subtitles_read_packet,
diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c
index 022b276fbd..c6b182dcbc 100644
--- a/libavformat/wc3movie.c
+++ b/libavformat/wc3movie.c
@@ -298,7 +298,7 @@ const FFInputFormat ff_wc3_demuxer = {
     .p.name         = "wc3movie",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Wing Commander III movie"),
     .priv_data_size = sizeof(Wc3DemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = wc3_probe,
     .read_header    = wc3_read_header,
     .read_packet    = wc3_read_packet,
diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index 56fc0f5167..6e60348764 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -219,7 +219,7 @@ const FFInputFormat ff_webvtt_demuxer = {
     .p.extensions   = "vtt",
     .p.priv_class   = &webvtt_demuxer_class,
     .priv_data_size = sizeof(WebVTTContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = webvtt_probe,
     .read_header    = webvtt_read_header,
     .read_packet    = webvtt_read_packet,
diff --git a/libavformat/xmv.c b/libavformat/xmv.c
index e2c4c7f93e..6a44d82016 100644
--- a/libavformat/xmv.c
+++ b/libavformat/xmv.c
@@ -581,7 +581,7 @@ const FFInputFormat ff_xmv_demuxer = {
     .p.long_name    = NULL_IF_CONFIG_SMALL("Microsoft XMV"),
     .p.extensions   = "xmv",
     .priv_data_size = sizeof(XMVDemuxContext),
-    .flags_internal = FF_FMT_INIT_CLEANUP,
+    .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
     .read_probe     = xmv_probe,
     .read_header    = xmv_read_header,
     .read_packet    = xmv_read_packet,
