diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 21d63ce189..38ac9dcbe7 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -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, diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 75c8a4703b..be6e532387 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -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 diff --git a/libavformat/demux.c b/libavformat/demux.c index dfc146d9c4..14776bc02f 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -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, diff --git a/libavformat/demux.h b/libavformat/demux.h index 7c22c870e2..ab1c001c9f 100644 --- a/libavformat/demux.h +++ b/libavformat/demux.h @@ -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. diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 9cfc711493..5b153c7c9e 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -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, diff --git a/libavformat/tta.c b/libavformat/tta.c index 26335202c7..70642324af 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -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, diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 4c47a5f05c..7d701c517a 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -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,