Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers
@ 2024-03-23  2:03 Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 02/15] avformat/hls: Don't access FFInputFormat.raw_codec_id Andreas Rheinhardt
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

The code relies on their presence and would presumably crash
when retrieving in_fmt->name if an encrypted stream with a codec id
without demuxer were encountered.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 343edb38ab..90d18e0970 100755
--- a/configure
+++ b/configure
@@ -3590,7 +3590,7 @@ flac_demuxer_select="flac_parser"
 flv_muxer_select="aac_adtstoasc_bsf"
 gxf_muxer_select="pcm_rechunk_bsf"
 hds_muxer_select="flv_muxer"
-hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer"
+hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser eac3_demuxer mov_demuxer mpegts_demuxer"
 hls_muxer_select="mov_muxer mpegts_muxer"
 iamf_demuxer_select="iamfdec"
 iamf_muxer_select="iamfenc"
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 02/15] avformat/hls: Don't access FFInputFormat.raw_codec_id
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 03/15] avformat/fitsdec: Don't use AVBPrint for temporary storage Andreas Rheinhardt
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It is an implementation detail of other input formats whether
they use raw_codec_id or not. The HLS demuxer should not rely
on this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/hls.c                   | 10 ++++++----
 libavformat/hls_sample_encryption.c |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index f6b44c2e35..94defa9384 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -2100,10 +2100,12 @@ static int hls_read_header(AVFormatContext *s)
          */
         if (seg && seg->key_type == KEY_SAMPLE_AES && pls->is_id3_timestamped &&
             pls->audio_setup_info.codec_id != AV_CODEC_ID_NONE) {
-            void *iter = NULL;
-            while ((in_fmt = av_demuxer_iterate(&iter)))
-                if (ffifmt(in_fmt)->raw_codec_id == pls->audio_setup_info.codec_id)
-                    break;
+            av_assert1(pls->audio_setup_info.codec_id == AV_CODEC_ID_AAC ||
+                       pls->audio_setup_info.codec_id == AV_CODEC_ID_AC3 ||
+                       pls->audio_setup_info.codec_id == AV_CODEC_ID_EAC3);
+            // Keep this list in sync with ff_hls_senc_read_audio_setup_info()
+            in_fmt = av_find_input_format(pls->audio_setup_info.codec_id == AV_CODEC_ID_AAC ? "aac" :
+                                          pls->audio_setup_info.codec_id == AV_CODEC_ID_AC3 ? "ac3" : "eac3");
         } else {
             pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
             pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? s->max_analyze_duration : 4 * AV_TIME_BASE;
diff --git a/libavformat/hls_sample_encryption.c b/libavformat/hls_sample_encryption.c
index d5b4c11b66..f412836d4f 100644
--- a/libavformat/hls_sample_encryption.c
+++ b/libavformat/hls_sample_encryption.c
@@ -64,6 +64,7 @@ void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *b
 
     info->codec_tag = AV_RL32(buf);
 
+    /* Always keep this list in sync with the one from hls_read_header() */
     if (info->codec_tag == MKTAG('z','a','a','c'))
         info->codec_id = AV_CODEC_ID_AAC;
     else if (info->codec_tag == MKTAG('z','a','c','3'))
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 03/15] avformat/fitsdec: Don't use AVBPrint for temporary storage
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 02/15] avformat/hls: Don't access FFInputFormat.raw_codec_id Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 04/15] avformat/g722: Inline constants Andreas Rheinhardt
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Most of the data in the temporary storage ends up being
returned to the user as AVPacket.data, so it makes sense
to avoid using the AVBPrint for temporary storage altogether
(in particular in light of the fact that the blocks read here
are too big for the small-string optimization anyway) and
read the data directly into AVPacket.data. This also avoids
another memcpy() from a stack buffer to the AVBPrint in ts_image()
(that could always have been avoided with av_bprint_get_buffer()).

These changes also allow to use av_append_packet(), which
greatly simplifies the code; furthermore, one can avoid cleanup
code on error as the packet is already unreferenced generically
on error.

There are two user-visible changes from this patch:
1. Truncated packets are now marked as corrupt.
2. AVPacket.pos is set (it corresponds to the discarded header
line, 80 bytes before the position corresponding to the
actual packet data).

Furthermore, this patch also removes code that triggered
a -Wtautological-constant-out-of-range-compare warning
from Clang (namely a comparison of an unsigned and INT64_MAX
in an assert).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/fitsdec.c | 80 ++++++++++++++-----------------------------
 1 file changed, 25 insertions(+), 55 deletions(-)

diff --git a/libavformat/fitsdec.c b/libavformat/fitsdec.c
index fe2dd5ad5d..6771dda327 100644
--- a/libavformat/fitsdec.c
+++ b/libavformat/fitsdec.c
@@ -24,13 +24,10 @@
  * FITS demuxer.
  */
 
-#include "libavutil/avassert.h"
-#include "libavutil/intreadwrite.h"
 #include "demux.h"
 #include "internal.h"
 #include "libavutil/opt.h"
 #include "libavcodec/fits.h"
-#include "libavutil/bprint.h"
 
 #define FITS_BLOCK_SIZE 2880
 
@@ -71,31 +68,31 @@ static int fits_read_header(AVFormatContext *s)
  * @param s pointer to AVFormat Context
  * @param fits pointer to FITSContext
  * @param header pointer to FITSHeader
- * @param avbuf pointer to AVBPrint to store the header
+ * @param pkt pointer to AVPacket to store the header
  * @param data_size to store the size of data part
- * @return 1 if image found, 0 if any other extension and AVERROR_INVALIDDATA otherwise
+ * @return 1 if image found, 0 if any other extension and AVERROR code otherwise
  */
-static int64_t is_image(AVFormatContext *s, FITSContext *fits, FITSHeader *header,
-                         AVBPrint *avbuf, uint64_t *data_size)
+static int is_image(AVFormatContext *s, FITSContext *fits, FITSHeader *header,
+                    AVPacket *pkt, uint64_t *data_size)
 {
     int i, ret, image = 0;
-    char buf[FITS_BLOCK_SIZE] = { 0 };
-    int64_t buf_size = 0, size = 0, t;
+    int64_t size = 0, t;
 
     do {
-        ret = avio_read(s->pb, buf, FITS_BLOCK_SIZE);
+        const uint8_t *buf, *buf_end;
+        ret = av_append_packet(s->pb, pkt, FITS_BLOCK_SIZE);
         if (ret < 0) {
             return ret;
         } else if (ret < FITS_BLOCK_SIZE) {
             return AVERROR_INVALIDDATA;
         }
 
-        av_bprint_append_data(avbuf, buf, FITS_BLOCK_SIZE);
         ret = 0;
-        buf_size = 0;
-        while(!ret && buf_size < FITS_BLOCK_SIZE) {
-            ret = avpriv_fits_header_parse_line(s, header, buf + buf_size, NULL);
-            buf_size += 80;
+        buf_end = pkt->data + pkt->size;
+        buf     = buf_end - FITS_BLOCK_SIZE;
+        while(!ret && buf < buf_end) {
+            ret = avpriv_fits_header_parse_line(s, header, buf, NULL);
+            buf += 80;
         }
     } while (!ret);
     if (ret < 0)
@@ -142,12 +139,10 @@ static int64_t is_image(AVFormatContext *s, FITSContext *fits, FITSHeader *heade
 
 static int fits_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    int64_t pos, ret;
     uint64_t size;
     FITSContext *fits = s->priv_data;
     FITSHeader header;
-    AVBPrint avbuf;
-    char *buf;
+    int ret;
 
     if (fits->first_image) {
         avpriv_fits_header_init(&header, STATE_SIMPLE);
@@ -155,57 +150,32 @@ static int fits_read_packet(AVFormatContext *s, AVPacket *pkt)
         avpriv_fits_header_init(&header, STATE_XTENSION);
     }
 
-    av_bprint_init(&avbuf, FITS_BLOCK_SIZE, AV_BPRINT_SIZE_UNLIMITED);
-    while ((ret = is_image(s, fits, &header, &avbuf, &size)) == 0) {
-        av_bprint_finalize(&avbuf, NULL);
-        pos = avio_skip(s->pb, size);
+    while ((ret = is_image(s, fits, &header, pkt, &size)) == 0) {
+        int64_t pos = avio_skip(s->pb, size);
         if (pos < 0)
             return pos;
 
-        av_bprint_init(&avbuf, FITS_BLOCK_SIZE, AV_BPRINT_SIZE_UNLIMITED);
         avpriv_fits_header_init(&header, STATE_XTENSION);
+        av_packet_unref(pkt);
     }
     if (ret < 0)
-        goto fail;
-
-    if (!av_bprint_is_complete(&avbuf)) {
-        ret = AVERROR(ENOMEM);
-        goto fail;
-    }
-
-    av_assert0(avbuf.len <= INT64_MAX && size <= INT64_MAX);
-    if (avbuf.len + size > INT_MAX - 80)  {
-        ret = AVERROR_INVALIDDATA;
-        goto fail;
-    }
-    // Header is sent with the first line removed...
-    ret = av_new_packet(pkt, avbuf.len - 80 + size);
-    if (ret < 0)
-        goto fail;
+        return ret;
 
     pkt->stream_index = 0;
-    pkt->flags |= AV_PKT_FLAG_KEY;
+    pkt->flags       |= AV_PKT_FLAG_KEY;
+    pkt->duration     = 1;
+    // Header is sent with the first line removed...
+    pkt->data        += 80;
+    pkt->size        -= 80;
 
-    ret = av_bprint_finalize(&avbuf, &buf);
-    if (ret < 0) {
-        return ret;
-    }
+    if (size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - pkt->size)
+        return AVERROR(ERANGE);
 
-    memcpy(pkt->data, buf + 80, avbuf.len - 80);
-    pkt->size = avbuf.len - 80;
-    av_freep(&buf);
-    ret = avio_read(s->pb, pkt->data + pkt->size, size);
+    ret = av_append_packet(s->pb, pkt, size);
     if (ret < 0)
         return ret;
 
-    pkt->size += ret;
-    pkt->duration = 1;
-
     return 0;
-
-fail:
-    av_bprint_finalize(&avbuf, NULL);
-    return ret;
 }
 
 static const AVOption fits_options[] = {
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 04/15] avformat/g722: Inline constants
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 02/15] avformat/hls: Don't access FFInputFormat.raw_codec_id Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 03/15] avformat/fitsdec: Don't use AVBPrint for temporary storage Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 05/15] avformat/wvedec: Inline constant Andreas Rheinhardt
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Forgotten in 5f0e161dd61552ad70760bad35b869eaec7368ff.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/g722.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavformat/g722.c b/libavformat/g722.c
index 15519d90b5..adb78e8db5 100644
--- a/libavformat/g722.c
+++ b/libavformat/g722.c
@@ -19,7 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "libavutil/avassert.h"
 #include "avformat.h"
 #include "demux.h"
 #include "internal.h"
@@ -38,10 +37,7 @@ static int g722_read_header(AVFormatContext *s)
     st->codecpar->sample_rate = 16000;
     st->codecpar->ch_layout   = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
 
-    st->codecpar->bits_per_coded_sample =
-        av_get_bits_per_sample(st->codecpar->codec_id);
-
-    av_assert0(st->codecpar->bits_per_coded_sample > 0);
+    st->codecpar->bits_per_coded_sample = 4;
 
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
     return 0;
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 05/15] avformat/wvedec: Inline constant
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (2 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 04/15] avformat/g722: Inline constants Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 06/15] avformat/fsb: Don't set data_offset manually Andreas Rheinhardt
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/wvedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/wvedec.c b/libavformat/wvedec.c
index 43e6359892..13934b78e4 100644
--- a/libavformat/wvedec.c
+++ b/libavformat/wvedec.c
@@ -45,7 +45,7 @@ static int wve_read_header(AVFormatContext *s)
     st->codecpar->codec_id    = AV_CODEC_ID_PCM_ALAW;
     st->codecpar->sample_rate = 8000;
     st->codecpar->ch_layout.nb_channels = 1;
-    st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);
+    st->codecpar->bits_per_coded_sample = 8;
     st->codecpar->block_align = st->codecpar->bits_per_coded_sample *
                                 st->codecpar->ch_layout.nb_channels / 8;
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 06/15] avformat/fsb: Don't set data_offset manually
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (3 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 05/15] avformat/wvedec: Inline constant Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 07/15] avformat/avr: Combine skips Andreas Rheinhardt
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It is set generically to the value that it is to here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/fsb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/fsb.c b/libavformat/fsb.c
index 4189822d8e..0febeffd56 100644
--- a/libavformat/fsb.c
+++ b/libavformat/fsb.c
@@ -157,7 +157,6 @@ static int fsb_read_header(AVFormatContext *s)
     }
 
     avio_skip(pb, offset - avio_tell(pb));
-    ffformatcontext(s)->data_offset = avio_tell(pb);
 
     avpriv_set_pts_info(st, 64, 1, par->sample_rate);
 
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 07/15] avformat/avr: Combine skips
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (4 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 06/15] avformat/fsb: Don't set data_offset manually Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 08/15] avformat/wady: " Andreas Rheinhardt
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avr.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/libavformat/avr.c b/libavformat/avr.c
index 12286c04d4..261edef4b5 100644
--- a/libavformat/avr.c
+++ b/libavformat/avr.c
@@ -49,8 +49,7 @@ static int avr_read_header(AVFormatContext *s)
 
     st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
 
-    avio_skip(s->pb, 4); // magic
-    avio_skip(s->pb, 8); // sample_name
+    avio_skip(s->pb, 4 /* magic */ + 8 /* sample_name */);
 
     chan = avio_rb16(s->pb);
     if (!chan) {
@@ -66,18 +65,13 @@ static int avr_read_header(AVFormatContext *s)
 
     sign = avio_rb16(s->pb);
 
-    avio_skip(s->pb, 2); // loop
-    avio_skip(s->pb, 2); // midi
-    avio_skip(s->pb, 1); // replay speed
+    avio_skip(s->pb, 2 /* loop */ + 2 /* midi */ + 1 /* replay speed */);
 
     st->codecpar->sample_rate = avio_rb24(s->pb);
     if (st->codecpar->sample_rate == 0)
         return AVERROR_INVALIDDATA;
 
-    avio_skip(s->pb, 4 * 3);
-    avio_skip(s->pb, 2 * 3);
-    avio_skip(s->pb, 20);
-    avio_skip(s->pb, 64);
+    avio_skip(s->pb, 4 * 3 + 2 * 3 + 20 + 64);
 
     st->codecpar->codec_id = ff_get_pcm_codec_id(bps, 0, 1, sign);
     if (st->codecpar->codec_id == AV_CODEC_ID_NONE) {
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 08/15] avformat/wady: Combine skips
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (5 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 07/15] avformat/avr: Combine skips Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 09/15] avformat/argo_cvg: Avoid relocations for ArgoCVGOverride Andreas Rheinhardt
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/wady.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/wady.c b/libavformat/wady.c
index 6dcc0018f3..17b7a88c19 100644
--- a/libavformat/wady.c
+++ b/libavformat/wady.c
@@ -45,13 +45,12 @@ static int wady_read_header(AVFormatContext *s)
     int channels, ret;
     AVStream *st;
 
-    avio_skip(pb, 4);
+    avio_skip(pb, 4 + 1);
 
     st = avformat_new_stream(s, NULL);
     if (!st)
         return AVERROR(ENOMEM);
 
-    avio_skip(pb, 1);
     par              = st->codecpar;
     par->codec_type  = AVMEDIA_TYPE_AUDIO;
     par->codec_id    = AV_CODEC_ID_WADY_DPCM;
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 09/15] avformat/argo_cvg: Avoid relocations for ArgoCVGOverride
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (6 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 08/15] avformat/wady: " Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 10/15] avformat/lafdec: Fix shadowing Andreas Rheinhardt
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

The average length of the strings used here does not differ much
from the length of the longest string; therefore it makes sense
to use an array big enough for the longest string and not
a pointer to a string. This also moves this array into .rodata
(from .data.rel.ro).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/argo_cvg.c | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
index 5db2a85dd8..03ae6fa59e 100644
--- a/libavformat/argo_cvg.c
+++ b/libavformat/argo_cvg.c
@@ -47,13 +47,6 @@ typedef struct ArgoCVGHeader {
     uint32_t reverb; /*< Reverb flag. */
 } ArgoCVGHeader;
 
-typedef struct ArgoCVGOverride {
-    const char    *name;
-    ArgoCVGHeader header;
-    uint32_t      checksum;
-    int           sample_rate;
-} ArgoCVGOverride;
-
 typedef struct ArgoCVGDemuxContext {
     ArgoCVGHeader header;
     uint32_t      checksum;
@@ -72,12 +65,33 @@ typedef struct ArgoCVGMuxContext {
 
 #if CONFIG_ARGO_CVG_DEMUXER
 /* "Special" files that are played at a different rate. */
+//  FILE(NAME, SIZE, LOOP, REVERB, CHECKSUM, SAMPLE_RATE)
+#define OVERRIDE_FILES(FILE)                               \
+    FILE(CRYS,     23592, 0, 1, 2495499, 88200) /* Beta */ \
+    FILE(REDCRY88, 38280, 0, 1, 4134848, 88200) /* Beta */ \
+    FILE(DANLOOP1, 54744, 1, 0, 5684641, 37800) /* Beta */ \
+    FILE(PICKUP88, 12904, 0, 1, 1348091, 48000) /* Beta */ \
+    FILE(SELECT1,   5080, 0, 1,  549987, 44100) /* Beta */ \
+
+#define MAX_FILENAME_SIZE(NAME, SIZE, LOOP, REVERB, CHECKSUM, SAMPLE_RATE) \
+    MAX_SIZE_BEFORE_ ## NAME,                                  \
+    MAX_SIZE_UNTIL_ ## NAME ## _MINUS1 = FFMAX(sizeof(#NAME ".CVG"), MAX_SIZE_BEFORE_ ## NAME) - 1,
+enum {
+    OVERRIDE_FILES(MAX_FILENAME_SIZE)
+    MAX_OVERRIDE_FILENAME_SIZE
+};
+
+typedef struct ArgoCVGOverride {
+    const char    name[MAX_OVERRIDE_FILENAME_SIZE];
+    ArgoCVGHeader header;
+    uint32_t      checksum;
+    int           sample_rate;
+} ArgoCVGOverride;
+
+#define FILE(NAME, SIZE, LOOP, REVERB, CHECKSUM, SAMPLE_RATE) \
+    { #NAME ".CVG", { SIZE, LOOP, REVERB }, CHECKSUM, SAMPLE_RATE },
 static const ArgoCVGOverride overrides[] = {
-    { "CRYS.CVG",     { 23592, 0, 1 }, 2495499, 88200 }, /* Beta */
-    { "REDCRY88.CVG", { 38280, 0, 1 }, 4134848, 88200 }, /* Beta */
-    { "DANLOOP1.CVG", { 54744, 1, 0 }, 5684641, 37800 }, /* Beta */
-    { "PICKUP88.CVG", { 12904, 0, 1 }, 1348091, 48000 }, /* Beta */
-    { "SELECT1.CVG",  {  5080, 0, 1 },  549987, 44100 }, /* Beta */
+    OVERRIDE_FILES(FILE)
 };
 
 static int argo_cvg_probe(const AVProbeData *p)
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 10/15] avformat/lafdec: Fix shadowing
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (7 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 09/15] avformat/argo_cvg: Avoid relocations for ArgoCVGOverride Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 11/15] avformat/cdg: Don't store avio_size() return value in int Andreas Rheinhardt
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/lafdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index 05f30691ba..77eab2ea6b 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -148,8 +148,8 @@ static int laf_read_header(AVFormatContext *ctx)
     if (!s->data)
         return AVERROR(ENOMEM);
 
-    for (int st = 0; st < st_count; st++) {
-        StreamParams *stp = &s->p[st];
+    for (unsigned i = 0; i < st_count; i++) {
+        StreamParams *stp = &s->p[i];
         AVCodecParameters *par;
         AVStream *st = avformat_new_stream(ctx, NULL);
         if (!st)
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 11/15] avformat/cdg: Don't store avio_size() return value in int
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (8 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 10/15] avformat/lafdec: Fix shadowing Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 12/15] avformat/pcmdec: Avoid av_freep(&(void*){NULL}) Andreas Rheinhardt
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/cdg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/cdg.c b/libavformat/cdg.c
index 2030cdff89..43d919e302 100644
--- a/libavformat/cdg.c
+++ b/libavformat/cdg.c
@@ -46,7 +46,7 @@ static int read_probe(const AVProbeData *p)
 static int read_header(AVFormatContext *s)
 {
     AVStream *vst;
-    int ret;
+    int64_t ret;
 
     vst = avformat_new_stream(s, NULL);
     if (!vst)
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 12/15] avformat/pcmdec: Avoid av_freep(&(void*){NULL})
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (9 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 11/15] avformat/cdg: Don't store avio_size() return value in int Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 13/15] avformat/pcmdec: Reindent after the previous commit Andreas Rheinhardt
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/pcmdec.c | 61 ++++++++++++++++++++++++++++----------------
 1 file changed, 39 insertions(+), 22 deletions(-)

diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index e9c97f7959..03feefb5bb 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -37,31 +37,20 @@ typedef struct PCMAudioDemuxerContext {
     AVChannelLayout ch_layout;
 } PCMAudioDemuxerContext;
 
-static int pcm_read_header(AVFormatContext *s)
+static int pcm_handle_mime_type(AVFormatContext *s, const char *prefix,
+                                AVCodecParameters *par)
 {
-    PCMAudioDemuxerContext *s1 = s->priv_data;
-    AVCodecParameters *par;
-    AVStream *st;
+    int rate = 0, channels = 0, little_endian = 0;
     uint8_t *mime_type = NULL;
-    int ret;
+    const char *options;
 
-    st = avformat_new_stream(s, NULL);
-    if (!st)
-        return AVERROR(ENOMEM);
-    par = st->codecpar;
+    av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);
+    if (!mime_type)
+        return 0;
 
-    par->codec_type  = AVMEDIA_TYPE_AUDIO;
-    par->codec_id    = ffifmt(s->iformat)->raw_codec_id;
-    par->sample_rate = s1->sample_rate;
-    ret = av_channel_layout_copy(&par->ch_layout, &s1->ch_layout);
-    if (ret < 0)
-        return ret;
+    if (!av_stristart(mime_type, prefix, &options)) /* audio/L16 */
+        goto end;
 
-    av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);
-    if (mime_type && s->iformat->mime_type) {
-        int rate = 0, channels = 0, little_endian = 0;
-        const char *options;
-        if (av_stristart(mime_type, s->iformat->mime_type, &options)) { /* audio/L16 */
             while (options = strchr(options, ';')) {
                 options++;
                 if (!rate)
@@ -89,10 +78,38 @@ static int pcm_read_header(AVFormatContext *s)
             }
             if (little_endian)
                 par->codec_id = AV_CODEC_ID_PCM_S16LE;
-        }
-    }
+
+end:
     av_freep(&mime_type);
 
+    return 0;
+}
+
+static int pcm_read_header(AVFormatContext *s)
+{
+    PCMAudioDemuxerContext *s1 = s->priv_data;
+    AVCodecParameters *par;
+    AVStream *st;
+    int ret;
+
+    st = avformat_new_stream(s, NULL);
+    if (!st)
+        return AVERROR(ENOMEM);
+    par = st->codecpar;
+
+    par->codec_type  = AVMEDIA_TYPE_AUDIO;
+    par->codec_id    = ffifmt(s->iformat)->raw_codec_id;
+    par->sample_rate = s1->sample_rate;
+    ret = av_channel_layout_copy(&par->ch_layout, &s1->ch_layout);
+    if (ret < 0)
+        return ret;
+
+    if (s->iformat->mime_type) {
+        ret = pcm_handle_mime_type(s, s->iformat->mime_type, par);
+        if (ret < 0)
+            return ret;
+    }
+
     par->bits_per_coded_sample = av_get_bits_per_sample(par->codec_id);
 
     av_assert0(par->bits_per_coded_sample > 0);
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 13/15] avformat/pcmdec: Reindent after the previous commit
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (10 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 12/15] avformat/pcmdec: Avoid av_freep(&(void*){NULL}) Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 14/15] avformat/vqf: Return 0 on success in read_packet Andreas Rheinhardt
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/pcmdec.c | 52 ++++++++++++++++++++++----------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index 03feefb5bb..e95a08df4b 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -51,33 +51,33 @@ static int pcm_handle_mime_type(AVFormatContext *s, const char *prefix,
     if (!av_stristart(mime_type, prefix, &options)) /* audio/L16 */
         goto end;
 
-            while (options = strchr(options, ';')) {
-                options++;
-                if (!rate)
-                    sscanf(options, " rate=%d",     &rate);
-                if (!channels)
-                    sscanf(options, " channels=%d", &channels);
-                if (!little_endian) {
-                     char val[sizeof("little-endian")];
-                     if (sscanf(options, " endianness=%13s", val) == 1) {
-                         little_endian = strcmp(val, "little-endian") == 0;
-                     }
-                }
+    while (options = strchr(options, ';')) {
+        options++;
+        if (!rate)
+            sscanf(options, " rate=%d",     &rate);
+        if (!channels)
+            sscanf(options, " channels=%d", &channels);
+        if (!little_endian) {
+            char val[sizeof("little-endian")];
+            if (sscanf(options, " endianness=%13s", val) == 1) {
+                little_endian = strcmp(val, "little-endian") == 0;
             }
-            if (rate <= 0) {
-                av_log(s, AV_LOG_ERROR,
-                       "Invalid sample_rate found in mime_type \"%s\"\n",
-                       mime_type);
-                av_freep(&mime_type);
-                return AVERROR_INVALIDDATA;
-            }
-            par->sample_rate = rate;
-            if (channels > 0) {
-                av_channel_layout_uninit(&par->ch_layout);
-                par->ch_layout.nb_channels = channels;
-            }
-            if (little_endian)
-                par->codec_id = AV_CODEC_ID_PCM_S16LE;
+        }
+    }
+    if (rate <= 0) {
+        av_log(s, AV_LOG_ERROR,
+               "Invalid sample_rate found in mime_type \"%s\"\n",
+               mime_type);
+        av_freep(&mime_type);
+        return AVERROR_INVALIDDATA;
+    }
+    par->sample_rate = rate;
+    if (channels > 0) {
+        av_channel_layout_uninit(&par->ch_layout);
+        par->ch_layout.nb_channels = channels;
+    }
+    if (little_endian)
+        par->codec_id = AV_CODEC_ID_PCM_S16LE;
 
 end:
     av_freep(&mime_type);
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 14/15] avformat/vqf: Return 0 on success in read_packet
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (11 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 13/15] avformat/pcmdec: Reindent after the previous commit Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 15/15] avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h Andreas Rheinhardt
  2024-03-25  1:54 ` [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Demuxers are not supposed to return the size of the packet read.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/vqf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 4c7f5aa22e..409c014a92 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -259,7 +259,7 @@ static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
     c->last_frame_bits = pkt->data[size+1];
     c->remaining_bits  = (size << 3) - c->frame_bit_len + c->remaining_bits;
 
-    return size+2;
+    return 0;
 }
 
 static int vqf_read_seek(AVFormatContext *s,
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [FFmpeg-devel] [PATCH 15/15] avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (12 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 14/15] avformat/vqf: Return 0 on success in read_packet Andreas Rheinhardt
@ 2024-03-23  2:06 ` Andreas Rheinhardt
  2024-03-25  1:54 ` [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-23  2:06 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only,
so this is the more appropriate place for it.
This does not preclude adding internal flags common to both
demuxer and muxer in the future.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavdevice/lavfi.c           | 2 +-
 libavformat/4xm.c             | 2 +-
 libavformat/aadec.c           | 2 +-
 libavformat/aaxdec.c          | 2 +-
 libavformat/ape.c             | 2 +-
 libavformat/aqtitledec.c      | 2 +-
 libavformat/assdec.c          | 2 +-
 libavformat/av1dec.c          | 4 ++--
 libavformat/avidec.c          | 2 +-
 libavformat/brstm.c           | 4 ++--
 libavformat/concatdec.c       | 2 +-
 libavformat/dashdec.c         | 2 +-
 libavformat/demux.c           | 2 +-
 libavformat/demux.h           | 8 +++++++-
 libavformat/dvdvideodec.c     | 2 +-
 libavformat/evcdec.c          | 2 +-
 libavformat/hls.c             | 2 +-
 libavformat/iamfdec.c         | 2 +-
 libavformat/icodec.c          | 2 +-
 libavformat/imfdec.c          | 2 +-
 libavformat/internal.h        | 6 ------
 libavformat/jacosubdec.c      | 2 +-
 libavformat/jpegxl_anim_dec.c | 2 +-
 libavformat/jvdec.c           | 2 +-
 libavformat/lafdec.c          | 2 +-
 libavformat/libgme.c          | 2 +-
 libavformat/libopenmpt.c      | 2 +-
 libavformat/lrcdec.c          | 2 +-
 libavformat/matroskadec.c     | 4 ++--
 libavformat/mccdec.c          | 2 +-
 libavformat/microdvddec.c     | 2 +-
 libavformat/mlvdec.c          | 2 +-
 libavformat/moflex.c          | 2 +-
 libavformat/mov.c             | 2 +-
 libavformat/mpeg.c            | 2 +-
 libavformat/mpl2dec.c         | 2 +-
 libavformat/mpsubdec.c        | 2 +-
 libavformat/mxfdec.c          | 2 +-
 libavformat/nsvdec.c          | 2 +-
 libavformat/nutdec.c          | 2 +-
 libavformat/oggdec.c          | 2 +-
 libavformat/omadec.c          | 2 +-
 libavformat/paf.c             | 2 +-
 libavformat/pdvdec.c          | 2 +-
 libavformat/pjsdec.c          | 2 +-
 libavformat/pp_bnk.c          | 2 +-
 libavformat/realtextdec.c     | 2 +-
 libavformat/rmdec.c           | 4 ++--
 libavformat/samidec.c         | 2 +-
 libavformat/sccdec.c          | 2 +-
 libavformat/scd.c             | 2 +-
 libavformat/segafilm.c        | 2 +-
 libavformat/sierravmd.c       | 2 +-
 libavformat/srtdec.c          | 2 +-
 libavformat/stldec.c          | 2 +-
 libavformat/subviewer1dec.c   | 2 +-
 libavformat/subviewerdec.c    | 2 +-
 libavformat/tedcaptionsdec.c  | 2 +-
 libavformat/tiertexseq.c      | 2 +-
 libavformat/vapoursynth.c     | 2 +-
 libavformat/vividas.c         | 2 +-
 libavformat/vplayerdec.c      | 2 +-
 libavformat/wc3movie.c        | 2 +-
 libavformat/webvttdec.c       | 2 +-
 libavformat/xmv.c             | 2 +-
 65 files changed, 74 insertions(+), 74 deletions(-)

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,
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers
  2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
                   ` (13 preceding siblings ...)
  2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 15/15] avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h Andreas Rheinhardt
@ 2024-03-25  1:54 ` Andreas Rheinhardt
  14 siblings, 0 replies; 16+ messages in thread
From: Andreas Rheinhardt @ 2024-03-25  1:54 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> The code relies on their presence and would presumably crash
> when retrieving in_fmt->name if an encrypted stream with a codec id
> without demuxer were encountered.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 343edb38ab..90d18e0970 100755
> --- a/configure
> +++ b/configure
> @@ -3590,7 +3590,7 @@ flac_demuxer_select="flac_parser"
>  flv_muxer_select="aac_adtstoasc_bsf"
>  gxf_muxer_select="pcm_rechunk_bsf"
>  hds_muxer_select="flv_muxer"
> -hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer"
> +hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser eac3_demuxer mov_demuxer mpegts_demuxer"
>  hls_muxer_select="mov_muxer mpegts_muxer"
>  iamf_demuxer_select="iamfdec"
>  iamf_muxer_select="iamfenc"

Will apply this patchset tomorrow unless there are objections.

- Andreas

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-03-25  1:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-23  2:03 [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 02/15] avformat/hls: Don't access FFInputFormat.raw_codec_id Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 03/15] avformat/fitsdec: Don't use AVBPrint for temporary storage Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 04/15] avformat/g722: Inline constants Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 05/15] avformat/wvedec: Inline constant Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 06/15] avformat/fsb: Don't set data_offset manually Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 07/15] avformat/avr: Combine skips Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 08/15] avformat/wady: " Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 09/15] avformat/argo_cvg: Avoid relocations for ArgoCVGOverride Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 10/15] avformat/lafdec: Fix shadowing Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 11/15] avformat/cdg: Don't store avio_size() return value in int Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 12/15] avformat/pcmdec: Avoid av_freep(&(void*){NULL}) Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 13/15] avformat/pcmdec: Reindent after the previous commit Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 14/15] avformat/vqf: Return 0 on success in read_packet Andreas Rheinhardt
2024-03-23  2:06 ` [FFmpeg-devel] [PATCH 15/15] avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.h Andreas Rheinhardt
2024-03-25  1:54 ` [FFmpeg-devel] [PATCH 01/15] configure: Make hls demuxer select AAC, AC3 and EAC3 demuxers Andreas Rheinhardt

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git