diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-26 01:10:51 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-28 23:44:28 +0200 |
commit | fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 (patch) | |
tree | 2fe2fb4377e34d93f9da1be3edf8928c426ed642 /libavcodec/ac3enc_float.c | |
parent | 4393331250d1f61be0d159de2a7976087a118c25 (diff) | |
download | ffmpeg-fdff1b9cbfd8cf5a9810c29efa4baf13a4786742.tar.gz |
avcodec/codec_internal: Avoid deprecation warnings for channel_layouts
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 <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/ac3enc_float.c')
-rw-r--r-- | libavcodec/ac3enc_float.c | 6 |
1 files changed, 1 insertions, 5 deletions
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 |