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 1C6A84F716 for ; Sat, 21 Jun 2025 21:38:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id DDC6B68CF8A; Sun, 22 Jun 2025 00:38:26 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id EBDF568C7C1 for ; Sun, 22 Jun 2025 00:38:20 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2A66541C7B for ; Sat, 21 Jun 2025 21:38:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1750541900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hyo5ZUtBLfi+PhJFw6Q2xLCMd5AlRTDLT/vF+abudBE=; b=clnmkcNDEN8stXuZ2AXK/WS4+YZW5vGb7OIpocrxcpObknU1xMb3HpeiRGxS+/X4oaWirM coUsxvKSmIk49B4eevc+eX98eTJFencxHYJJvfOUF2ziYtpLkGEJ2ausqtOOCtMd8/pYmH 2ZbVh+3b96NVVVNyfOuBgbinut/nW4mEgSRQMMbtfjnmnM8xfeT4N1ksl+/mDorMJ3WPzi 7SiPhSITGx3Xmub67tY7gwp3BE6qXItNe7fs07iICTj1bqVHMeyFehsdnYYvYKuu2Na5sO HGadCA4h8Vxbt/uxvmwiHCUvWi/j9dV9aiZeBXXsAZ9n0tiModDQyGOuxPkPMw== Date: Sat, 21 Jun 2025 23:38:18 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250621213818.GX29660@pb2> References: <20250617143659.26607-1-pkoshevoy@gmail.com> <20250621212118.GW29660@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdduvdefkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdludehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepffehvefhvddvhfdtgfethfdtueelfedtveekffeljeethfegtdfhfefggfeufedtnecuffhomhgrihhnpehffhhmphgvghdrohhrghenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/demux: Add allow_codec_changes option to AVFormatContext (v2) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============7645384152583957967==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7645384152583957967== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xlnHmLCHCaRn+q+w" Content-Disposition: inline --xlnHmLCHCaRn+q+w Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 21, 2025 at 03:26:58PM -0600, Pavel Koshevoy wrote: > On Sat, Jun 21, 2025 at 3:21=E2=80=AFPM Michael Niedermayer > wrote: >=20 > > On Tue, Jun 17, 2025 at 08:36:59AM -0600, Pavel Koshevoy wrote: > > > Make runtime AVStream.codecpar codec_id updates optional and disabled > > > by default, so that avformat API clients can enable this feature > > explicitly > > > when they add support for runtime codec changes. > > > > > > Accordingly, codec_close should not assume that the codec_id cannot > > change. > > > This fixes 'ffprobe 1_poc.mp4' segfault introduced with > > > commit 0021484d05f9b0f032fa319399de6e24eea0c04f. > > > --- > > > doc/APIchanges | 3 +++ > > > doc/formats.texi | 6 ++++++ > > > libavformat/avformat.h | 10 ++++++++++ > > > libavformat/demux.c | 8 +++++++- > > > libavformat/mpegts.c | 4 +++- > > > libavformat/options_table.h | 1 + > > > libavformat/version.h | 2 +- > > > tests/fate/demux.mak | 2 +- > > > 8 files changed, 32 insertions(+), 4 deletions(-) > > > > [...] > > > > > diff --git a/libavformat/demux.c b/libavformat/demux.c > > > index ecd4f40da9..3749ab67a3 100644 > > > --- a/libavformat/demux.c > > > +++ b/libavformat/demux.c > > > @@ -1292,9 +1292,15 @@ static int codec_close(FFStream *sti) > > > { > > > AVCodecContext *avctx_new =3D NULL; > > > AVCodecParameters *par_tmp =3D NULL; > > > + const AVCodec *new_codec =3D NULL; > > > int ret; > > > > > > - avctx_new =3D avcodec_alloc_context3(sti->avctx->codec); > > > + new_codec =3D > > > + (sti->avctx->codec_id !=3D sti->pub.codecpar->codec_id) ? > > > + avcodec_find_decoder(sti->pub.codecpar->codec_id) : > > > + sti->avctx->codec; > > > + > > > + avctx_new =3D avcodec_alloc_context3(new_codec); > > > if (!avctx_new) { > > > ret =3D AVERROR(ENOMEM); > > > goto fail; > > > > this should be a seperate patch > > >=20 > It already exists as a separate patch: > https://ffmpeg.org/pipermail/ffmpeg-devel/2025-June/344890.html it should not be in "avformat/demux: Add allow_codec_changes option to AVFo= rmatContext" the allow_codec_changes patch is ok without this thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle --xlnHmLCHCaRn+q+w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaFcmQQAKCRBhHseHBAsP qzV9AJ9dTrFDsUs0f6yLWNKd3vZxATc8AwCfXrii6ZPapGdP2KFi347t5CFJV70= =Mt/u -----END PGP SIGNATURE----- --xlnHmLCHCaRn+q+w-- --===============7645384152583957967== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7645384152583957967==--