---
libavcodec/aac_ac3_parser.c | 14 ++++++++++++++
libavcodec/ac3dec.c | 28 ++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index 1f73fed..9bb9cea 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -84,14 +84,28 @@ get_next:
avctx->sample_rate = s->sample_rate;
/* (E-)AC-3: allow downmixing to stereo or mono */
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (s->channels > 1 &&
(avctx->request_channels == 1 ||
avctx->request_channel_layout == AV_CH_LAYOUT_MONO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ if (s->channels > 1 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
+#endif
avctx->channels = 1;
avctx->channel_layout = AV_CH_LAYOUT_MONO;
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
} else if (s->channels > 2 &&
(avctx->request_channels == 2 ||
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ } else if (s->channels > 2 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
+#endif
avctx->channels = 2;
avctx->channel_layout = AV_CH_LAYOUT_STEREO;
} else {
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 15dd022..481116f 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -179,13 +179,27 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
/* allow downmixing to stereo or mono */
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->channels > 1 &&
(avctx->request_channels == 1 ||
avctx->request_channel_layout == AV_CH_LAYOUT_MONO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ if (avctx->channels > 1 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
+#endif
avctx->channels = 1;
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
} else if (avctx->channels > 2 &&
(avctx->request_channels == 2 ||
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ } else if (avctx->channels > 2 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
+#endif
avctx->channels = 2;
}
s->downmixed = 1;
@@ -1354,15 +1368,29 @@ static int ac3_decode_frame(AVCodecContext * avctx,
void *data,
s->output_mode = s->channel_mode;
if (s->lfe_on)
s->output_mode |= AC3_OUTPUT_LFEON;
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
if (s->channels > 1 &&
(avctx->request_channels == 1 ||
avctx->request_channel_layout == AV_CH_LAYOUT_MONO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ if (s->channels > 1 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_MONO) {
+#endif
s->out_channels = 1;
s->output_mode = AC3_CHMODE_MONO;
s->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode];
+#if FF_API_REQUEST_CHANNELS
+FF_DISABLE_DEPRECATION_WARNINGS
} else if (s->channels > 2 &&
(avctx->request_channels == 2 ||
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)) {
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+ } else if (s->channels > 2 &&
+ avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
+#endif
s->out_channels = 2;
s->output_mode = AC3_CHMODE_STEREO;
s->channel_layout = avpriv_ac3_channel_layout_tab[s->output_mode];
--
1.8.3.4 (Apple Git-47)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel