summaryrefslogtreecommitdiffstats
path: root/libavcodec/libshine.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2025-03-07 01:19:27 +0100
committerAndreas Rheinhardt <[email protected]>2025-03-10 00:57:23 +0100
commit0971fcf0a0821388c5258f46f73bdfbdeadd1b52 (patch)
tree492901755220c4b71d211b1eeab5412d04d0d89f /libavcodec/libshine.c
parent0349ae3ec4c2d381b0ce163b4195ecbba422a484 (diff)
avcodec/codec_internal, all: Use macros to set deprecated AVCodec fields
The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones. Signed-off-by: Andreas Rheinhardt <[email protected]>
Diffstat (limited to 'libavcodec/libshine.c')
-rw-r--r--libavcodec/libshine.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c
index 333d86f774..aa71383bfb 100644
--- a/libavcodec/libshine.c
+++ b/libavcodec/libshine.c
@@ -137,12 +137,8 @@ const FFCodec ff_libshine_encoder = {
.init = libshine_encode_init,
FF_CODEC_ENCODE_CB(libshine_encode_frame),
.close = libshine_encode_close,
- .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P,
- AV_SAMPLE_FMT_NONE },
- .p.supported_samplerates = libshine_sample_rates,
- .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO,
- AV_CHANNEL_LAYOUT_STEREO,
- { 0 },
- },
+ CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
+ CODEC_SAMPLERATES_ARRAY(libshine_sample_rates),
+ CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO),
.p.wrapper_name = "libshine",
};