From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5221341D47 for ; Sun, 20 Mar 2022 20:09:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B357368B124; Sun, 20 Mar 2022 22:09:36 +0200 (EET) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3DEA268A5B3 for ; Sun, 20 Mar 2022 22:09:30 +0200 (EET) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 22KK9Tjf002303 for ; Sun, 20 Mar 2022 21:09:29 +0100 Received: by phare.normalesup.org (Postfix, from userid 1001) id 3D77DE0095; Sun, 20 Mar 2022 21:09:29 +0100 (CET) Date: Sun, 20 Mar 2022 21:09:29 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <20220320200634.51420-1-jamrial@gmail.com> MIME-Version: 1.0 In-Reply-To: <20220320200634.51420-1-jamrial@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Sun, 20 Mar 2022 21:09:29 +0100 (CET) Subject: Re: [FFmpeg-devel] [PATCH 7/7] ffmpeg: make the ac option set the demuxer's ch_layout AVOption 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="===============4936764159353989865==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4936764159353989865== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EZ/DVWTJjv1Iu8dM" Content-Disposition: inline --EZ/DVWTJjv1Iu8dM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable James Almer (12022-03-20): > channels is deprecated on all supported raw demuxers. >=20 > Signed-off-by: James Almer > --- > fftools/ffmpeg_opt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) I like this version much better. Thanks. > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c > index 720a3cc46a..b3edbf9885 100644 > --- a/fftools/ffmpeg_opt.c > +++ b/fftools/ffmpeg_opt.c > @@ -1122,7 +1122,11 @@ static int open_input_file(OptionsContext *o, cons= t char *filename) > if (file_iformat && (priv_class =3D file_iformat->priv_class) && > av_opt_find(&priv_class, "channels", NULL, 0, > AV_OPT_SEARCH_FAKE_OBJ)) { > - av_dict_set_int(&o->g->format_opts, "channels", o->audio_cha= nnels[o->nb_audio_channels - 1].u.i, 0); > + AVBPrint bp; > + av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC); > + av_bprintf(&bp, "%dC", o->audio_channels[o->nb_audio_channel= s - 1].u.i); > + av_dict_set(&o->g->format_opts, "ch_layout", bp.str, 0); > + av_bprint_finalize(&bp, NULL); You do not need a BPrint for that, the size of the expansion of %d is very limited, especially the values that can be relevant here. > } > } > if (o->nb_audio_ch_layouts) { Regards, --=20 Nicolas George --EZ/DVWTJjv1Iu8dM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAmI3ifcACgkQcZVLI8pN xgylxA//X1bCxDwRTkF2wyj6LLIaP9lh+21+SL0x6PEWN4K4PsUc3aDMI5kyWVYG xV1UNK4UafaZGOZYRALJE1sWiFrKSu1S+WOnVRYWwNBl3oxu/ThhqbfARzB3yjTY UEmgHURn4TRCZe82ZjG3LvmzZrORTtHeo4X71I10nwm5eGd6AjaukU4spNvwlzNA Ela6gDxyEkGZr+K4qxu/DlyslKbDvOWNUn4PeuvGGW6/ZMnKju7sdXxznRqOtXmi ZomWOupx6R2Ib2LXqYXKjycohMCKKGGgkr0HwKcfwzdzTPc5Ng9d/KN8vRRQJnP4 H9yNtJGnCu1iscISLVT0/oLV6O2Mjx3vcOgUlcvDordPp50ntAVfjeCytB5VYGrB vGj+YPjIKada8392WGqGvzEU/q5yCjgDOmDXPFZ3eVtyL/4pEw2lyeF5FLRJWfNB /cLBshfupyFqzjclnnDWFkCjSIdJEDQ9oQ1VusMND8uL3l3cSSC3Vwg6OJMnxSN9 orA1ycPj92tG0l0+LUCIZKuMMot0KJ7iJ6UDwzQTSEspWP2AcULYkiQkPA4US3Mj hwYLsML53O7ubPJeQe5L3gR1MyJQW+BdO1lRvGcD33z7/KJ1U45g5SUBZ21RFxsW AMy6UadSVUJbTloPJrkcq+FyaYFiO6XdkQ9iRjQ8b/ZJGJ3HDzI= =bcJ9 -----END PGP SIGNATURE----- --EZ/DVWTJjv1Iu8dM-- --===============4936764159353989865== 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". --===============4936764159353989865==--