From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A81644C2A8 for ; Wed, 3 Sep 2025 18:51:19 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'xpcmQFBv3QMhrYC3ikIO2sCRoGZGDnVvMTKfWzmpdgk=', expected b'PIPMigyuH5gfsL5zdh3TDgV33qtnFOyKYbHm2bVsK+g=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1756925454; h=mime-version : to : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=xpcmQFBv3QMhrYC3ikIO2sCRoGZGDnVvMTKfWzmpdgk=; b=Mr3uzkG/e7p09fxXZyLs+YG2koHP5l2oNQ1lweDKAXeKWF7e8baep/0f/KbWEf1lN6efH 2N1R1xduSOzG2J+CdqAaxDXMxPMlcOn+OfLq5dyQAMwZsfq30ZrXVRjYkhkW8hhQdT9rXMl zf1aGESHkedBGUWSsX0VxRdP8ZF7g1YnVZ9XP6lwhPCNyPqQHMfddUBUf6TW1D7j1RWN9tA oTz5Yh5aH+SkTIkxCl8oRKS+T8KiWywIwYi7kay7Mb1o1JKIakxj/n4REsy2HHs2teWtWCs TX0VIiwQRDFjw1MsnOzCSGtV23+/V9NRHqiVadLC3gv/MJ03DNyu2JgUFuOQ== Received: from [172.19.0.4] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id EBB5068E7B5; Wed, 3 Sep 2025 21:50:54 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1756925437; b=T8S/xkomUrrjzLLOQfj12Id21KqMJVa8s0TC94SbcY62CccI3PxWRAKjlvrazelbzUPLV UEaNR7gGi5jyC3f8h9CECcBvpHq81z4O/Eb7HSRHw2bvMQ9SiC62Y/h3Ck/mREMeavvjLjd TL9cekxOpq36KHfTgXG9o4zlwLh/aqn2NrCpstudcKJVIR+2dP+8Hjye2tMg/BYyGxORcs9 qoyV2SXoSh2E34maA4x5ZICc5RY+8fX+Tdp34CQA4/QsQazypIiJe0uCF+ofd+0r3yylqAe iCK3PNME7fy51OGQORNua4tlrFK2XCNHEfBzMC5RF3kyFQo7fF3ljfnF3RNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1756925437; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=nh7dHe9utdqYaKi0i2pvsIq4AIaGlffkGbR0/Y4N6Ko=; b=U/ahdUHE8YyIMdyHBbFeoJOTDpdE4oqgmfB3j1vNeACQX1WFMqSjSdYmD6q/hneAbxfBE 2QVSXFZy9N2s/akWATyQdOa9Opc6g9c5YiT/WwC3HW+dT1czYhsWleyoJS0J5/rEpX+RmMI fDFxKAG1XIi4eAuULoGxJcas4TlmQLUjlnhbiuuE5GhL6xJaK3hwaB1G4CS4jilyFYU+M3G TDAkdgSiQj7tdKOf3a9XftOhpqpzbGpHEvNcDhL9Zap0P4TJdQOjkQVkMnota0Vs9X10/NM 1+6rHiexi5dbhFxlsFnUKPbj3mRrQitGUAVCrbZYPr2Rhf6dl3ezdz7ddNBw== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=none Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1756925429; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : from; bh=PIPMigyuH5gfsL5zdh3TDgV33qtnFOyKYbHm2bVsK+g=; b=5CPNZxxljNky+UC1iLL6X5Z6syJRgc/laSNc/uME40DSF9eNqTcpM3C/3hFxsSj+XmL6l noB6LQsSjbKWSpFtxhMNHE4lfQIiLKNW9Aw9CrVk5SG6/8zE/oTNgx1cN8UcpOCSI5cjy0f wwDXQQguhqbr2wi2KfIMghpdjaNpYLC/v52yeQJ4GEth2jg6A7WnSOQYNFjgQGb/inxbzdI mhEosw2Wqv2UvV9QUY17NuHJm95048Iq+nMs/yAsFgZ9tYD/tCkgiclju0qxTd80iXLRghD cP9H+ZwduMbuumvxo1gJkJdJvg8tgp1VH6+mJNBBYNKKfDCMWRtHQnj2uYpA== Received: from 5d8f51c41678 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2A4A968E6D2 for ; Wed, 3 Sep 2025 21:50:29 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Message-ID: <175692542934.25.10213430836298304878@463a07221176> Message-ID-Hash: MNWZM6YHFGBO4ZVPBASLSCFDBZZP67L3 X-Message-ID-Hash: MNWZM6YHFGBO4ZVPBASLSCFDBZZP67L3 X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avformat/avformat: Make AVFMT_FLAG_ID3V2_AUTO private (PR #20419) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: mkver via ffmpeg-devel Cc: mkver Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20419 opened by mkver URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20419 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20419.patch It has been pushed just now (without version bump and APIchanges entry...), so it can be made private without deprecation. >>From f5cc1af53ab04c3ccf8786983c7b5ab69398b742 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 3 Sep 2025 20:38:48 +0200 Subject: [PATCH 1/3] 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 9d037c54f209958d47ac376d2a9561608f98dfae 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 --- libavformat/aacdec.c | 3 ++- libavformat/avformat.h | 1 - libavformat/demux.c | 2 +- libavformat/demux.h | 5 +++++ libavformat/mp3dec.c | 3 ++- libavformat/tta.c | 2 +- libavformat/wavdec.c | 3 ++- 7 files changed, 13 insertions(+), 6 deletions(-) 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, -- 2.49.1 >>From 86903255e83678d3c8bb4ad0a61d5599d3f0b9a7 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 3 Sep 2025 20:46:28 +0200 Subject: [PATCH 2/3] avformat/demux: Avoid always-true branch Since 9d037c54f209958d47ac376d2a9561608f98dfae id3v2_extra_meta can only be != NULL if the input format wants ID3v2 tags to be read generically. Signed-off-by: Andreas Rheinhardt --- libavformat/demux.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 14776bc02f..6ced69a99b 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -325,15 +325,12 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, } if (id3v2_extra_meta) { - if (is_id3v2_format(s->iformat)) { if ((ret = ff_id3v2_parse_apic(s, id3v2_extra_meta)) < 0) goto close; if ((ret = ff_id3v2_parse_chapters(s, id3v2_extra_meta)) < 0) goto close; if ((ret = ff_id3v2_parse_priv(s, id3v2_extra_meta)) < 0) goto close; - } else - av_log(s, AV_LOG_DEBUG, "demuxer does not support additional id3 data, skipping\n"); ff_id3v2_free_extra_meta(&id3v2_extra_meta); } -- 2.49.1 >>From beb71bb71d6fc2ea10bcba26f969683cd9ab5990 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 3 Sep 2025 20:48:07 +0200 Subject: [PATCH 3/3] avformat/demux: Reindent after the previous commit Signed-off-by: Andreas Rheinhardt --- libavformat/demux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 6ced69a99b..cc0d57ae97 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -325,12 +325,12 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, } if (id3v2_extra_meta) { - if ((ret = ff_id3v2_parse_apic(s, id3v2_extra_meta)) < 0) - goto close; - if ((ret = ff_id3v2_parse_chapters(s, id3v2_extra_meta)) < 0) - goto close; - if ((ret = ff_id3v2_parse_priv(s, id3v2_extra_meta)) < 0) - goto close; + if ((ret = ff_id3v2_parse_apic(s, id3v2_extra_meta)) < 0) + goto close; + if ((ret = ff_id3v2_parse_chapters(s, id3v2_extra_meta)) < 0) + goto close; + if ((ret = ff_id3v2_parse_priv(s, id3v2_extra_meta)) < 0) + goto close; ff_id3v2_free_extra_meta(&id3v2_extra_meta); } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org