1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avformat/avformat: Make AVFMT_FLAG_ID3V2_AUTO private

This flag governs whether avformat_open_input() reads
ID3v2 tags generically; some demuxers without this flag
read these tags themselves in a non-generic way,
e.g. oma. This makes this flag an implementation detail
that should not be exposed to the user, i.e. an internal flag.

Given that 9d037c54f2
did not bump version and added no APIchanges entry
I deemded it inappropriate to bump version or add
an APIchanges entry for the removal of AVFMT_FLAG_ID3V2_AUTO.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-09-03 20:38:48 +02:00
committed by James Almer
parent a3360c0eaf
commit e918e202e0
7 changed files with 13 additions and 6 deletions

View File

@@ -208,9 +208,10 @@ retry:
const FFInputFormat ff_aac_demuxer = {
.p.name = "aac",
.p.long_name = NULL_IF_CONFIG_SMALL("raw ADTS AAC (Advanced Audio Coding)"),
.p.flags = AVFMT_GENERIC_INDEX | AVFMT_FLAG_ID3V2_AUTO,
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "aac",
.p.mime_type = "audio/aac,audio/aacp,audio/x-aac",
.flags_internal = FF_INFMT_FLAG_ID3V2_AUTO,
.read_probe = adts_aac_probe,
.read_header = adts_aac_read_header,
.read_packet = adts_aac_read_packet,

View File

@@ -1435,7 +1435,6 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
#define AVFMT_FLAG_ID3V2_AUTO 0x400000 ///< Automatically parse ID3v2 metadata
/**
* Maximum number of bytes read from input in order to determine stream

View File

@@ -215,7 +215,7 @@ static int update_stream_avctx(AVFormatContext *s)
}
static av_always_inline int is_id3v2_format(const AVInputFormat *fmt) {
return fmt->flags & AVFMT_FLAG_ID3V2_AUTO;
return ffifmt(fmt)->flags_internal & FF_INFMT_FLAG_ID3V2_AUTO;
}
int avformat_open_input(AVFormatContext **ps, const char *filename,

View File

@@ -39,6 +39,11 @@ struct AVDeviceInfoList;
*/
#define FF_INFMT_FLAG_PREFER_CODEC_FRAMERATE (1 << 1)
/**
* Automatically parse ID3v2 metadata
*/
#define FF_INFMT_FLAG_ID3V2_AUTO (1 << 2)
typedef struct FFInputFormat {
/**
* The public AVInputFormat. See avformat.h for it.

View File

@@ -618,10 +618,11 @@ static const AVClass demuxer_class = {
const FFInputFormat ff_mp3_demuxer = {
.p.name = "mp3",
.p.long_name = NULL_IF_CONFIG_SMALL("MP2/3 (MPEG audio layer 2/3)"),
.p.flags = AVFMT_GENERIC_INDEX | AVFMT_FLAG_ID3V2_AUTO,
.p.flags = AVFMT_GENERIC_INDEX,
.p.extensions = "mp2,mp3,m2a,mpa", /* XXX: use probe */
.p.priv_class = &demuxer_class,
.p.mime_type = "audio/mpeg",
.flags_internal = FF_INFMT_FLAG_ID3V2_AUTO,
.read_probe = mp3_read_probe,
.read_header = mp3_read_header,
.read_packet = mp3_read_packet,

View File

@@ -191,9 +191,9 @@ static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
const FFInputFormat ff_tta_demuxer = {
.p.name = "tta",
.p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"),
.p.flags = AVFMT_FLAG_ID3V2_AUTO,
.p.extensions = "tta",
.priv_data_size = sizeof(TTAContext),
.flags_internal = FF_INFMT_FLAG_ID3V2_AUTO,
.read_probe = tta_probe,
.read_header = tta_read_header,
.read_packet = tta_read_packet,

View File

@@ -1011,10 +1011,11 @@ static const AVClass w64_demuxer_class = {
const FFInputFormat ff_w64_demuxer = {
.p.name = "w64",
.p.long_name = NULL_IF_CONFIG_SMALL("Sony Wave64"),
.p.flags = AVFMT_GENERIC_INDEX | AVFMT_FLAG_ID3V2_AUTO,
.p.flags = AVFMT_GENERIC_INDEX,
.p.codec_tag = ff_wav_codec_tags_list,
.p.priv_class = &w64_demuxer_class,
.priv_data_size = sizeof(WAVDemuxContext),
.flags_internal = FF_INFMT_FLAG_ID3V2_AUTO,
.read_probe = w64_probe,
.read_header = w64_read_header,
.read_packet = wav_read_packet,