summaryrefslogtreecommitdiff
path: root/libavcodec/aptxenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-26 01:10:51 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-09-28 23:44:28 +0200
commitfdff1b9cbfd8cf5a9810c29efa4baf13a4786742 (patch)
tree2fe2fb4377e34d93f9da1be3edf8928c426ed642 /libavcodec/aptxenc.c
parent4393331250d1f61be0d159de2a7976087a118c25 (diff)
downloadffmpeg-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/aptxenc.c')
-rw-r--r--libavcodec/aptxenc.c8
1 files changed, 2 insertions, 6 deletions
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 },