mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-02 13:24:20 +08:00
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>
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user