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 9BB5444B5E for ; Sat, 21 Jun 2025 21:21:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id C100A68CDE5; Sun, 22 Jun 2025 00:21:26 +0300 (EEST) Received: from relay16.mail.gandi.net (relay16.mail.gandi.net [217.70.178.236]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 619BE68C53B for ; Sun, 22 Jun 2025 00:21:20 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A05D144A1F for ; Sat, 21 Jun 2025 21:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1750540879; 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=m8U7hHvUNecGxEKvbwznp9fTbOv1R5tVUTMGKxs7YH8=; b=bYMYkpBS/qiClvwhfzsk+qx8XbRlNdLwhltc/L8l26becVySnDIOeqlupkCqV/XHT6OCXa Q0BNThDkNEIvNBbFDDIhY6XdtuW8hSyauCIggrUaByGRakk2Ra4z+csxsk5z85uwChJjjG copIenFWrokpgQqRCyLM/hjtxwSTG8YGJlsl2lhEEfBMHo8Ap7ukwQJ2QUdatnSlx6E/ib CwhKd6gAk9TuovPRqkkXnJZ9TKVSp75WjIQ3urnlNx8R5TDB+eWaZkuk5wDd1QknKSe7KX W8fhydjYBoA161CTU/G3KGZM+GXJ4TqONd6kWwn7wHCvT8h7Y3KY2MHgg8PRPw== Date: Sat, 21 Jun 2025 23:21:18 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250621212118.GW29660@pb2> References: <20250617143659.26607-1-pkoshevoy@gmail.com> MIME-Version: 1.0 In-Reply-To: <20250617143659.26607-1-pkoshevoy@gmail.com> X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdduvdefgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh 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="===============2166722893744322041==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2166722893744322041== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t6rfnJsATvMPgCK9" Content-Disposition: inline --t6rfnJsATvMPgCK9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 explicit= ly > when they add support for runtime codec changes. >=20 > Accordingly, codec_close should not assume that the codec_id cannot chang= e. > 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; > =20 > - 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 thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle --t6rfnJsATvMPgCK9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaFciSAAKCRBhHseHBAsP q8RiAJ9OG09v1n31dR53PeTSJczW8KH3IwCePg1qKWak4rb3RWYgTnZckkf9Cb0= =v7Wx -----END PGP SIGNATURE----- --t6rfnJsATvMPgCK9-- --===============2166722893744322041== 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". --===============2166722893744322041==--