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 C7E804410C for ; Wed, 28 Sep 2022 01:08:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1868768BAEF; Wed, 28 Sep 2022 04:08:54 +0300 (EEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-oln040092064069.outbound.protection.outlook.com [40.92.64.69]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2437668A4CD for ; Wed, 28 Sep 2022 04:08:48 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GbR4zAlVO53RA4Ryn0iFMOQBk4abkNpcQmcAnoqRC8LG2DoUTewjPhsBo3o8KXAMBqBGhP4EvordPQeoZeXDTxtGWbysRihrJaXnrlv4ju61xTLyJK8kc547ERVfG2rYStsAh8YgjPtWhBNDlCR9Wxl81nliWQg8iD6ueJhTQawdWTd99DwSB7gBueaOIyKnNkycfk1sQyIUbrW3gES3aroPdEsXUjr2IUD1nGtoab6n3WKpR9xBZva40bTWu1C0j/jSQHgQAzZdCUqU4PlV3ZT/Q1eoZLxPglKs+pMtPcCGZprSBt2eNjhmRxwf0GFBdU9F36fcKxR+O94pLCuFGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5B2sfp48Ff6A1eI+/C4EkPYk3Tml4D03yJV04PIBwgg=; b=D7oZxp2ZzYX2CKy6h8R/yTotkJyxBZCJAtN/yQqsoKzeJR1IR7ik5A7Vm8cL7RQbOl/IQrk5mzsAff7kOQCeOU8X9f9wIkncY89609An2sfwCS/vhoJ7KcSwOOUSD8xUWLYfmJyEgoMdSyetvQv/opkBHl3GrxGoIU2ODUi/JdphziHzvmAFODDPkUh4nVKcUxPcfRrnmICdUoXYzoEP1crmEsdL82dZERI7SSQOL3nHIOaDAtA749p++1Tn3AHpPok1bwJzBtVzC86Pm5ZXizZ4K11v3ewCV9AniGWZqKSs+1HPwhBUJt7lYYzpWwd+3sSjh4LgJOpDZvG4ERIuvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5B2sfp48Ff6A1eI+/C4EkPYk3Tml4D03yJV04PIBwgg=; b=bBmZQE1kMjgbvkLgRf3BIOA6rOoWSF91yFsiEh9V8+QgvOefD1CRs4LHbScazD98HJStqh+kPekJsdstnfNZNmfiZOTGYymQr1GLmNl0OwaSWkTpQLMqYsw70G0EuoO+2/OdfCQ4bHZ2GW4PGpCHgzDjJ5p3Wq4mcK6LwMovN8XT5G8/OYnY/09j1GFHQxm6p4Q4Qb4NyyFXEFK4A38ytmxSlv1iU6zRx5+OCSr5STBg7PqwfhVso7Vw3N/5VI5vBQo20m5WjcYdLi4J3EKolakX5MhMT/BeqsmnIdMXjHZko5ovLUQsVrJHJCfviJJaJUw1/SPKv1nZ5+3Welb+2g== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AM8P250MB0011.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:3da::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Wed, 28 Sep 2022 01:08:46 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Wed, 28 Sep 2022 01:08:46 +0000 Message-ID: Date: Wed, 28 Sep 2022 03:08:51 +0200 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: From: Andreas Rheinhardt In-Reply-To: X-TMN: [zkZzXHL0G87AwWpulEBwCAgIRH0xQq+K] X-ClientProxiedBy: FR0P281CA0118.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AM8P250MB0011:EE_ X-MS-Office365-Filtering-Correlation-Id: d3b375ea-9ddc-47d7-8f57-08daa0edfe3a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gGSJ/CkD9dQhfz9bOsW8J/EaBb5asBfiFV6hK3bVNPlzBpynyhmrBAsq76PlZpLlndNe8YTu1ClUBpXh85CiB28OTmGYYXpxjqhyUQAAgfS2J5BP5JHMjxUDfNO60tD0xkZowvDJbj5oamSy1d1Zddgg147NDB/TziknJvrKDNllxmVa0Jz1rmAR3+1RBC6mEFCjPZUTxfF4UGAvvPCGqZ9RSv0hbWZAsMR0Wt/o0qSXyWzXBYHyvbGJJceKa3ONUAj/utnuUF/lACDI+8J5afqqQOyUczG9Y2OY76SNN8/yQaDoJcYsMh8MLJRBFP73awPNnYHe4So7FHh1qp1RI3Mfs4cEqA7axM8SzHqGzYEbbvF2nMMgnvQR4WrBVwIK/Dv7itsBgyI66vx2+EKPerg4oR04nogUuL2eZ3g56roXuJ6iOCCCKMBanzq9y5IjclsBrE2pJyb1sHfyjocNyM8kqOsnIhUkZsWieJHrGI/qo5PbDBBuMvfoallb+A8cze4M8j5RLu1LqohIQsyRGMIyj0U7e+eAOI5PBabgwoNBa6g8rkKv0Ns8DR5/W4uc/lCWsTrv+/PRRGpU7LfyviL7bVSNjP/LFFL6fMRAYB7y9M7ct1CNYtkQ15QS3WvC65MbyvpStCrSBCuu1LYUs9TwsxF0oy6dB9K16fQUZvrUhmgecGvkQVc/ccEWzwRb X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDdObVU0T1JVUG1oZVR6Qk1RWGlnbE1PbjdYbXZ1QWdpeUtLT0hyS1ZJWTVK?= =?utf-8?B?dEtGSEpuMFdENk1UTVVOUGpWU2RKeEtYZXdEUXI0Qjc4QkVNak5WTnNhVlk0?= =?utf-8?B?NG50QitMeS81SFB6OXhXU2hRQzhRb3o4Y1d1d3RkQytKNFRvaW9ibVhLOU9v?= =?utf-8?B?eDdYSnY4cWJ5VE5OU3B4UTVjcTJuKzJUZEJVbWQzcFpGNmhjQXpqMm91WDAv?= =?utf-8?B?RWkxVHgxcmExcU9IRWVEQVRLWnRJb0syLzJUekNSWnBCWGxsT05NYXY5bnpJ?= =?utf-8?B?ZmZ4NGZqNk9KVjJ2dGxWeXhyRXdvYk9xaGVHVENHMHlpaTJTM1k5ZFZWQUZk?= =?utf-8?B?cEdJUE9nNGlEU3NYTDk5ODhFTlc3SlJzYllSNUM2NzNlbnY4WHVPdVVFK2Zx?= =?utf-8?B?NW96OU1jbEppYUNPbi84YUdQWkxBdE1ESEUzTlJLbXJRSUcweWpyTzB5Wmsz?= =?utf-8?B?U1RzOXhKRnp2anptc3BHdUE2K2MvSFhkdlF3eTc0bzZjSnFqVjV4MVppcGdU?= =?utf-8?B?MFZnVEk3ei9QNUFuNlhlYXd2VHAwYWwzeUQ0YnJHN0FYaUVFYTlVNTZ2emgv?= =?utf-8?B?WkJHNzdab05HZzFUYXBWRzMrNHR3Y0dNRlhBcTY0WktOcUtIVUJrV2xld21p?= =?utf-8?B?RFpSZ3JYbTNrblR2Z29teEtaMThlVmlJL0lLVERDRW5hV2NlUVhYbkl1SHR2?= =?utf-8?B?ZVMzdnlZUGpQR2I2V3NOcitXbTFGL2VWVXVVNzhyc2VDQnhRUXZZSlp5bkk2?= =?utf-8?B?emp2b2xaS2dYR3kzR1A2V3JHbU5NbjcxdUZ6UmlCM3J1VUVYazRTTWpwL0dN?= =?utf-8?B?TVhMb0ZOdnJHZ1pGL0tyZEV3UUdxcmcrU21TVEZ6bCtRMVNjWVR1dDdTWFI5?= =?utf-8?B?WFY2ZEdZQXJBcTJMOCtCWURtaDdseXRTTDZmMmJCRWc3UTRmeER3bmdHcW9i?= =?utf-8?B?MGltMUtYU2VGOFhOOWhnSUFUSTNiU2hUbDBvSzFSTlRCaEJiWGJVM2pkQWNp?= =?utf-8?B?YjV6NWJNUGpoU0tRcklZRGhTMkZ3SlA4Q21nZnBoNzM1T05scXgwN3g0Y29y?= =?utf-8?B?cVk2TUk3OTZsTGVXYWM5NTg3QzNneTdQckszeHR4YzRRQXFBNGp3THRQNGtz?= =?utf-8?B?R2l1MUtLcnhLWTV1a3d6YTlGR2tjZ3JSYWg1ZXp2YW9ZaklpdCtkb2NjMkg2?= =?utf-8?B?emZLU1NaZUtUaEp1ZjY2ck9rblZkQ1NyRXNkM0k0eUpkRCtNMTBoMjR2cWs2?= =?utf-8?B?eStjdkY2MEhYYU5iZmZVNGV2cWNwTjZUQ2N2MC9EeXNzQ1NDVS9KV0R4NEJI?= =?utf-8?B?d1JaSmM0UU1Vb0RZUmlZd3JDQUZyUVZFbGZ6L1l1MnYxYm1ENGxwZDFsU2o5?= =?utf-8?B?WkN6aGlUSk1va3I5VHlCaXVPeUwySThqRmVGVjh2clEvT3JPUnorUWJvVHR5?= =?utf-8?B?d2Y1NjlSendqYTgvajFDa1NOVzdPbytLNFh3dFg2NEI1Zm9OdkFZeFlBd0FL?= =?utf-8?B?NS9qVmt6SndsdDFRaGplZjY4Y1JOV0pUS3k4UUFjRjdYa01FSThPL2JqL0ZS?= =?utf-8?B?Vm1LUHY3enhPb2paMEFsL24xNjdudE53WkptNmsxRVRaeFdaL0VyYjBRQ2JV?= =?utf-8?B?QmtxR0N1SVg2U0t4L2MrYU5Cck1IMXFBNGRGdlVUUnBvUnB1WkdKeTM5Ty9G?= =?utf-8?B?NS9lTHFoL2RsUUpOWk0xM0dBSGd4Y3g0T2NUSnN6ZGxqUzczY1NTNmNWalFU?= =?utf-8?Q?3JIiNCpNz661hvL1WF4GCWVzImm9UY2uMhEcH8u?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3b375ea-9ddc-47d7-8f57-08daa0edfe3a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 01:08:46.1320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P250MB0011 Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/codec_internal: Avoid deprecation warnings for channel_layouts 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Andreas Rheinhardt: > AVCodec.channel_layouts is deprecated and Clang (unlike GCC) > warns when setting this field in a codec definition. > Fortunately, Clang (unlike GCC) allows to use > FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec), > so that one can create simple macros to set AVCodec.channel_layouts > that also suppress deprecation warnings for Clang. > > (Notice that some of the codec definitions were already > inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not > guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed. > Also notice that setting AVCodec.channel_layouts was not guarded > by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it > it without removing all the codeblocks would not have worked.) > > Signed-off-by: Andreas Rheinhardt > --- > According to godbolt both of these assumptions about Clang > are true for the oldest Clang version provided by godbolt > (namely 3.0). > > Can someone test audiotoolboxenc just to be sure? > > libavcodec/aacdec.c | 8 ++------ > libavcodec/aacdec_fixed.c | 4 +--- > libavcodec/ac3enc_fixed.c | 6 +----- > libavcodec/ac3enc_float.c | 6 +----- > libavcodec/alacenc.c | 6 +----- > libavcodec/aptxdec.c | 8 ++------ > libavcodec/aptxenc.c | 8 ++------ > libavcodec/audiotoolboxenc.c | 2 +- > libavcodec/codec_internal.h | 19 +++++++++++++++++++ > libavcodec/dcaenc.c | 11 +++-------- > libavcodec/eac3enc.c | 6 +----- > libavcodec/g722enc.c | 4 +--- > libavcodec/libcodec2.c | 8 ++------ > libavcodec/libfdk-aacenc.c | 4 +--- > libavcodec/libgsmenc.c | 8 ++------ > libavcodec/libmp3lame.c | 6 +----- > libavcodec/libshine.c | 6 +----- > libavcodec/libspeexenc.c | 6 +----- > libavcodec/libtwolame.c | 7 +------ > libavcodec/mlpenc.c | 8 ++------ > libavcodec/mpegaudioenc_fixed.c | 6 +----- > libavcodec/mpegaudioenc_float.c | 6 +----- > libavcodec/opusenc.c | 5 +---- > libavcodec/pcm-blurayenc.c | 7 ++----- > libavcodec/pcm-dvdenc.c | 9 ++------- > libavcodec/ra144enc.c | 4 +--- > libavcodec/s302menc.c | 5 ----- > libavcodec/sbcdec.c | 5 +---- > libavcodec/sbcenc.c | 5 +---- > libavcodec/vorbisdec.c | 4 +--- > 30 files changed, 57 insertions(+), 140 deletions(-) > > diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c > index 2d448103df..2fdfd6b221 100644 > --- a/libavcodec/aacdec.c > +++ b/libavcodec/aacdec.c > @@ -566,9 +566,7 @@ const FFCodec ff_aac_decoder = { > }, > .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = aac_channel_layout, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) > .p.ch_layouts = aac_ch_layout, > .flush = flush, > .p.priv_class = &aac_decoder_class, > @@ -594,9 +592,7 @@ const FFCodec ff_aac_latm_decoder = { > }, > .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = aac_channel_layout, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) > .p.ch_layouts = aac_ch_layout, > .flush = flush, > .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), > diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c > index 4b2085335d..8c5dad2813 100644 > --- a/libavcodec/aacdec_fixed.c > +++ b/libavcodec/aacdec_fixed.c > @@ -464,9 +464,7 @@ const FFCodec ff_aac_fixed_decoder = { > }, > .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = aac_channel_layout, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) > .p.ch_layouts = aac_ch_layout, > .p.priv_class = &aac_decoder_class, > .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), > diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c > index a22d3b4abf..a52a598152 100644 > --- a/libavcodec/ac3enc_fixed.c > +++ b/libavcodec/ac3enc_fixed.c > @@ -119,7 +119,6 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx) > } > > > -FF_DISABLE_DEPRECATION_WARNINGS > const FFCodec ff_ac3_fixed_encoder = { > .p.name = "ac3_fixed", > CODEC_LONG_NAME("ATSC A/52A (AC-3)"), > @@ -135,10 +134,7 @@ const FFCodec ff_ac3_fixed_encoder = { > .p.priv_class = &ff_ac3enc_class, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > .p.supported_samplerates = ff_ac3_sample_rate_tab, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = ff_ac3_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) > .p.ch_layouts = ff_ac3_ch_layouts, > .defaults = ff_ac3_enc_defaults, > }; > -FF_ENABLE_DEPRECATION_WARNINGS > diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c > index 6238980690..3ca7d113c2 100644 > --- a/libavcodec/ac3enc_float.c > +++ b/libavcodec/ac3enc_float.c > @@ -123,7 +123,6 @@ av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx) > return ff_ac3_encode_init(avctx); > } > > -FF_DISABLE_DEPRECATION_WARNINGS > const FFCodec ff_ac3_encoder = { > .p.name = "ac3", > CODEC_LONG_NAME("ATSC A/52A (AC-3)"), > @@ -138,11 +137,8 @@ const FFCodec ff_ac3_encoder = { > AV_SAMPLE_FMT_NONE }, > .p.priv_class = &ff_ac3enc_class, > .p.supported_samplerates = ff_ac3_sample_rate_tab, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = ff_ac3_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) > .p.ch_layouts = ff_ac3_ch_layouts, > .defaults = ff_ac3_enc_defaults, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > }; > -FF_ENABLE_DEPRECATION_WARNINGS > diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c > index 362d4f8ba6..0f685d71d6 100644 > --- a/libavcodec/alacenc.c > +++ b/libavcodec/alacenc.c > @@ -648,7 +648,6 @@ static const AVClass alacenc_class = { > .version = LIBAVUTIL_VERSION_INT, > }; > > -FF_DISABLE_DEPRECATION_WARNINGS > const FFCodec ff_alac_encoder = { > .p.name = "alac", > CODEC_LONG_NAME("ALAC (Apple Lossless Audio Codec)"), > @@ -660,12 +659,9 @@ const FFCodec ff_alac_encoder = { > .init = alac_encode_init, > FF_CODEC_ENCODE_CB(alac_encode_frame), > .close = alac_encode_close, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = alac_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(alac_channel_layouts) > .p.ch_layouts = ff_alac_ch_layouts, > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, > AV_SAMPLE_FMT_S16P, > AV_SAMPLE_FMT_NONE }, > }; > -FF_ENABLE_DEPRECATION_WARNINGS > diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c > index d254b3026b..3ae7a00803 100644 > --- a/libavcodec/aptxdec.c > +++ b/libavcodec/aptxdec.c > @@ -183,9 +183,7 @@ const FFCodec ff_aptx_decoder = { > .init = ff_aptx_init, > FF_CODEC_DECODE_CB(aptx_decode_frame), > .p.capabilities = AV_CODEC_CAP_DR1, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, > AV_SAMPLE_FMT_NONE }, > @@ -202,9 +200,7 @@ const FFCodec ff_aptx_hd_decoder = { > .init = ff_aptx_init, > FF_CODEC_DECODE_CB(aptx_decode_frame), > .p.capabilities = AV_CODEC_CAP_DR1, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, > AV_SAMPLE_FMT_NONE }, > diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c > index 114e286fe2..5fc0378f5d 100644 > --- a/libavcodec/aptxenc.c > +++ b/libavcodec/aptxenc.c > @@ -276,9 +276,7 @@ const FFCodec ff_aptx_encoder = { > .init = aptx_encode_init, > FF_CODEC_ENCODE_CB(aptx_encode_frame), > .close = aptx_close, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, > AV_SAMPLE_FMT_NONE }, > @@ -297,9 +295,7 @@ const FFCodec ff_aptx_hd_encoder = { > .init = aptx_encode_init, > FF_CODEC_ENCODE_CB(aptx_encode_frame), > .close = aptx_close, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, > AV_SAMPLE_FMT_NONE }, > diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c > index 02a863bf03..1ccfda4d20 100644 > --- a/libavcodec/audiotoolboxenc.c > +++ b/libavcodec/audiotoolboxenc.c > @@ -627,7 +627,7 @@ static const AVOption options[] = { > .p.priv_class = &ffat_##NAME##_enc_class, \ > .p.capabilities = AV_CODEC_CAP_DELAY | \ > AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ > - .p.channel_layouts = CHANNEL_LAYOUTS, \ > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \ > .p.ch_layouts = CH_LAYOUTS, \ > .p.sample_fmts = (const enum AVSampleFormat[]) { \ > AV_SAMPLE_FMT_S16, \ > diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h > index 2d9b4f6460..e3b77e6dea 100644 > --- a/libavcodec/codec_internal.h > +++ b/libavcodec/codec_internal.h > @@ -276,6 +276,25 @@ typedef struct FFCodec { > .update_thread_context_for_user = NULL > #endif > > +#if FF_API_OLD_CHANNEL_LAYOUT > +#define CODEC_OLD_CHANNEL_LAYOUTS(...) CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(((const uint64_t[]) { __VA_ARGS__, 0 })) > +#if defined(__clang__) > +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) \ > + FF_DISABLE_DEPRECATION_WARNINGS \ > + .p.channel_layouts = (array), \ > + FF_ENABLE_DEPRECATION_WARNINGS > +#else > +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) .p.channel_layouts = (array), > +#endif > +#else > +/* This is only provided to allow to test disabling FF_API_OLD_CHANNEL_LAYOUT > + * without removing all the FF_API_OLD_CHANNEL_LAYOUT codeblocks. > + * It is of course still expected to be removed when FF_API_OLD_CHANNEL_LAYOUT > + * will be finally removed (along with all usages of these macros). */ > +#define CODEC_OLD_CHANNEL_LAYOUTS(...) > +#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) > +#endif > + > #define FF_CODEC_DECODE_CB(func) \ > .cb_type = FF_CODEC_CB_TYPE_DECODE, \ > .cb.decode = (func) > diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c > index 46618c13f9..eec6965b5f 100644 > --- a/libavcodec/dcaenc.c > +++ b/libavcodec/dcaenc.c > @@ -1324,14 +1324,9 @@ const FFCodec ff_dca_encoder = { > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, > AV_SAMPLE_FMT_NONE }, > .p.supported_samplerates = sample_rates, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - AV_CH_LAYOUT_2_2, > - AV_CH_LAYOUT_5POINT0, > - AV_CH_LAYOUT_5POINT1, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, > + AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0, > + AV_CH_LAYOUT_5POINT1) > .p.ch_layouts = (const AVChannelLayout[]){ > AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c > index 648c93dcaa..78d4f1399a 100644 > --- a/libavcodec/eac3enc.c > +++ b/libavcodec/eac3enc.c > @@ -249,7 +249,6 @@ void ff_eac3_output_frame_header(AC3EncodeContext *s) > } > > > -FF_DISABLE_DEPRECATION_WARNINGS > const FFCodec ff_eac3_encoder = { > .p.name = "eac3", > CODEC_LONG_NAME("ATSC A/52 E-AC-3"), > @@ -264,11 +263,8 @@ const FFCodec ff_eac3_encoder = { > AV_SAMPLE_FMT_NONE }, > .p.priv_class = &eac3enc_class, > .p.supported_samplerates = ff_ac3_sample_rate_tab, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = ff_ac3_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) > .p.ch_layouts = ff_ac3_ch_layouts, > .defaults = ff_ac3_enc_defaults, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > }; > -FF_ENABLE_DEPRECATION_WARNINGS > diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c > index dc044c320d..bc08211b1d 100644 > --- a/libavcodec/g722enc.c > +++ b/libavcodec/g722enc.c > @@ -381,9 +381,7 @@ const FFCodec ff_adpcm_g722_encoder = { > .close = g722_encode_close, > FF_CODEC_ENCODE_CB(g722_encode_frame), > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > .p.ch_layouts = (const AVChannelLayout[]){ > AV_CHANNEL_LAYOUT_MONO, { 0 } > }, > diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c > index 581ef04ce2..5728d915c2 100644 > --- a/libavcodec/libcodec2.c > +++ b/libavcodec/libcodec2.c > @@ -189,9 +189,7 @@ const FFCodec ff_libcodec2_decoder = { > .init = libcodec2_init_decoder, > .close = libcodec2_close, > FF_CODEC_DECODE_CB(libcodec2_decode), > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > }; > > const FFCodec ff_libcodec2_encoder = { > @@ -209,7 +207,5 @@ const FFCodec ff_libcodec2_encoder = { > .init = libcodec2_init_encoder, > .close = libcodec2_close, > FF_CODEC_ENCODE_CB(libcodec2_encode), > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > }; > diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c > index fc2e71c51f..d589964453 100644 > --- a/libavcodec/libfdk-aacenc.c > +++ b/libavcodec/libfdk-aacenc.c > @@ -494,8 +494,6 @@ const FFCodec ff_libfdk_aac_encoder = { > .p.profiles = profiles, > .p.supported_samplerates = aac_sample_rates, > .p.wrapper_name = "libfdk", > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = aac_channel_layout, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) > .p.ch_layouts = aac_ch_layouts, > }; > diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c > index 9ad430bf62..bd3b1420aa 100644 > --- a/libavcodec/libgsmenc.c > +++ b/libavcodec/libgsmenc.c > @@ -127,9 +127,7 @@ const FFCodec ff_libgsm_encoder = { > FF_CODEC_ENCODE_CB(libgsm_encode_frame), > .close = libgsm_encode_close, > .defaults = libgsm_defaults, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }, > @@ -148,9 +146,7 @@ const FFCodec ff_libgsm_ms_encoder = { > FF_CODEC_ENCODE_CB(libgsm_encode_frame), > .close = libgsm_encode_close, > .defaults = libgsm_defaults, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }, > diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c > index c8a6eb8c33..26e58baa3d 100644 > --- a/libavcodec/libmp3lame.c > +++ b/libavcodec/libmp3lame.c > @@ -345,11 +345,7 @@ const FFCodec ff_libmp3lame_encoder = { > AV_SAMPLE_FMT_S16P, > AV_SAMPLE_FMT_NONE }, > .p.supported_samplerates = libmp3lame_sample_rates, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 }, > diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c > index e266229f03..2f6a9233e0 100644 > --- a/libavcodec/libshine.c > +++ b/libavcodec/libshine.c > @@ -140,11 +140,7 @@ const FFCodec ff_libshine_encoder = { > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, > AV_SAMPLE_FMT_NONE }, > .p.supported_samplerates = libshine_sample_rates, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 }, > diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c > index 2191e7dac7..9fdb247863 100644 > --- a/libavcodec/libspeexenc.c > +++ b/libavcodec/libspeexenc.c > @@ -354,11 +354,7 @@ const FFCodec ff_libspeex_encoder = { > .close = encode_close, > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 }, > diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c > index 2168b3cdf6..9c0156aa25 100644 > --- a/libavcodec/libtwolame.c > +++ b/libavcodec/libtwolame.c > @@ -228,12 +228,7 @@ const FFCodec ff_libtwolame_encoder = { > AV_SAMPLE_FMT_S16P, > AV_SAMPLE_FMT_NONE > }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { > - AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { > AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c > index a8b0486cf3..1bc8995c58 100644 > --- a/libavcodec/mlpenc.c > +++ b/libavcodec/mlpenc.c > @@ -2252,9 +2252,7 @@ const FFCodec ff_mlp_encoder = { > .close = mlp_encode_close, > .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, > .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = ff_mlp_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) > .p.ch_layouts = ff_mlp_ch_layouts, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > }; > @@ -2274,9 +2272,7 @@ const FFCodec ff_truehd_encoder = { > .close = mlp_encode_close, > .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, > .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) > .p.ch_layouts = (const AVChannelLayout[]) { > AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c > index 3b2bcb3594..afbffe766b 100644 > --- a/libavcodec/mpegaudioenc_fixed.c > +++ b/libavcodec/mpegaudioenc_fixed.c > @@ -37,11 +37,7 @@ const FFCodec ff_mp2fixed_encoder = { > .p.supported_samplerates = (const int[]){ > 44100, 48000, 32000, 22050, 24000, 16000, 0 > }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 } }, > diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c > index 64b5bbda6e..212709c291 100644 > --- a/libavcodec/mpegaudioenc_float.c > +++ b/libavcodec/mpegaudioenc_float.c > @@ -38,11 +38,7 @@ const FFCodec ff_mp2_encoder = { > .p.supported_samplerates = (const int[]){ > 44100, 48000, 32000, 22050, 24000, 16000, 0 > }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 } }, > diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c > index a7a9d3a5f5..324fcd64a6 100644 > --- a/libavcodec/opusenc.c > +++ b/libavcodec/opusenc.c > @@ -740,10 +740,7 @@ const FFCodec ff_opus_encoder = { > .close = opus_encode_end, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > .p.supported_samplerates = (const int []){ 48000, 0 }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, { 0 } }, > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, > diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c > index 03ed88b8ae..62e86e722f 100644 > --- a/libavcodec/pcm-blurayenc.c > +++ b/libavcodec/pcm-blurayenc.c > @@ -279,8 +279,7 @@ const FFCodec ff_pcm_bluray_encoder = { > .init = pcm_bluray_encode_init, > FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), > .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { > + CODEC_OLD_CHANNEL_LAYOUTS( > AV_CH_LAYOUT_MONO, > AV_CH_LAYOUT_STEREO, > AV_CH_LAYOUT_SURROUND, > @@ -290,9 +289,7 @@ const FFCodec ff_pcm_bluray_encoder = { > AV_CH_LAYOUT_5POINT0, > AV_CH_LAYOUT_5POINT1, > AV_CH_LAYOUT_7POINT0, > - AV_CH_LAYOUT_7POINT1, > - 0 }, > -#endif > + AV_CH_LAYOUT_7POINT1) > .p.ch_layouts = (const AVChannelLayout[]) { > AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c > index e9349680e8..011d0a2f00 100644 > --- a/libavcodec/pcm-dvdenc.c > +++ b/libavcodec/pcm-dvdenc.c > @@ -181,13 +181,8 @@ const FFCodec ff_pcm_dvd_encoder = { > .init = pcm_dvd_encode_init, > FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), > .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, > - AV_CH_LAYOUT_5POINT1, > - AV_CH_LAYOUT_7POINT1, > - 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, > + AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > AV_CHANNEL_LAYOUT_5POINT1, > diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c > index d9448e88c8..ea537f3f80 100644 > --- a/libavcodec/ra144enc.c > +++ b/libavcodec/ra144enc.c > @@ -549,8 +549,6 @@ const FFCodec ff_ra_144_encoder = { > .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }, > .p.supported_samplerates = (const int[]){ 8000, 0 }, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) > .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, > }; > diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c > index ad59325ec4..3bd657f945 100644 > --- a/libavcodec/s302menc.c > +++ b/libavcodec/s302menc.c > @@ -184,9 +184,4 @@ const FFCodec ff_s302m_encoder = { > AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }, > .p.supported_samplerates = (const int[]) { 48000, 0 }, > - /* .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, > - AV_CH_LAYOUT_QUAD, > - AV_CH_LAYOUT_5POINT1_BACK, > - AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX, > - 0 }, */ > }; > diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c > index 51411eb16b..3fac2f5016 100644 > --- a/libavcodec/sbcdec.c > +++ b/libavcodec/sbcdec.c > @@ -374,10 +374,7 @@ const FFCodec ff_sbc_decoder = { > .init = sbc_decode_init, > FF_CODEC_DECODE_CB(sbc_decode_frame), > .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 } }, > diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c > index d7e9fb4198..721c97e1ea 100644 > --- a/libavcodec/sbcenc.c > +++ b/libavcodec/sbcenc.c > @@ -352,10 +352,7 @@ const FFCodec ff_sbc_encoder = { > .priv_data_size = sizeof(SBCEncContext), > .init = sbc_encode_init, > FF_CODEC_ENCODE_CB(sbc_encode_frame), > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, > - AV_CH_LAYOUT_STEREO, 0}, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) > .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, > AV_CHANNEL_LAYOUT_STEREO, > { 0 } }, > diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c > index 0d04e7c2c4..4a85500c10 100644 > --- a/libavcodec/vorbisdec.c > +++ b/libavcodec/vorbisdec.c > @@ -1876,9 +1876,7 @@ const FFCodec ff_vorbis_decoder = { > .flush = vorbis_decode_flush, > .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, > .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > -#if FF_API_OLD_CHANNEL_LAYOUT > - .p.channel_layouts = ff_vorbis_channel_layouts, > -#endif > + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_vorbis_channel_layouts) > .p.ch_layouts = ff_vorbis_ch_layouts, > .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, > AV_SAMPLE_FMT_NONE }, Will apply tonight unless there are objections. - Andreas _______________________________________________ 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".