From dab12d811984f0840be8b06b23f4eff190baa4c9 Mon Sep 17 00:00:00 2001
From: Marcus Johnson <bumblebritches57@gmail.com>
Date: Sat, 23 Aug 2014 23:55:34 -0400
Subject: [PATCH 1/2] Replace deprecated function calls

from request_channels to request_channel_layout
---
 libavcodec/dcadec.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 82d96d2..f4f601f 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2333,8 +2333,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
     /* If we have XXCH then the channel layout is managed differently */
     /* note that XLL will also have another way to do things */
     if (!(s->core_ext_mask & DCA_EXT_XXCH)
-        || (s->core_ext_mask & DCA_EXT_XXCH && avctx->request_channels > 0
-            && avctx->request_channels
+        || (s->core_ext_mask & DCA_EXT_XXCH && avctx->request_channel_layout > 0
+            && avctx->request_channel_layout
             < num_core_channels + !!s->lfe + s->xxch_chset_nch[0]))
     { /* xxx should also do MA extensions */
         if (s->amode < 16) {
@@ -2353,8 +2353,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
 #if FF_API_REQUEST_CHANNELS
 FF_DISABLE_DEPRECATION_WARNINGS
             if (s->xch_present && !s->xch_disable &&
-                (!avctx->request_channels ||
-                 avctx->request_channels > num_core_channels + !!s->lfe)) {
+                (!avctx->request_channel_layout ||
+                 avctx->request_channel_layout > num_core_channels + !!s->lfe)) {
 FF_ENABLE_DEPRECATION_WARNINGS
 #else
             if (s->xch_present && !s->xch_disable) {
@@ -2409,11 +2409,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
         /* we only get here if an XXCH channel set can be added to the mix */
         channel_mask = s->xxch_core_spkmask;
 
-        if (avctx->request_channels > 0
-            && avctx->request_channels < s->prim_channels) {
+        if (avctx->request_channel_layout > 0
+            && avctx->request_channel_layout < s->prim_channels) {
             channels = num_core_channels + !!s->lfe;
             for (i = 0; i < s->xxch_chset && channels + s->xxch_chset_nch[i]
-                                              <= avctx->request_channels; i++) {
+                                              <= avctx->request_channel_layout; i++) {
                 channels += s->xxch_chset_nch[i];
                 channel_mask |= s->xxch_spk_masks[i];
             }
@@ -2615,7 +2615,7 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
     /* allow downmixing to stereo */
 #if FF_API_REQUEST_CHANNELS
 FF_DISABLE_DEPRECATION_WARNINGS
-    if (avctx->request_channels == 2)
+    if (avctx->request_channel_layout == 2)
         avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
-- 
1.9.3 (Apple Git-50)


From 60ee2ddc43f0dcbd182d86ee8342d7053aa49f50 Mon Sep 17 00:00:00 2001
From: Marcus Johnson <bumblebritches57@gmail.com>
Date: Sun, 24 Aug 2014 03:00:52 -0400
Subject: [PATCH 2/2] Re-enable deprecation warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The deprecated function calls have been removed, so remove the if-def’d
warnings
---
 libavcodec/dcadec.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index f4f601f..16bce50 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -2351,11 +2351,9 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
             }
 
 #if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
             if (s->xch_present && !s->xch_disable &&
                 (!avctx->request_channel_layout ||
                  avctx->request_channel_layout > num_core_channels + !!s->lfe)) {
-FF_ENABLE_DEPRECATION_WARNINGS
 #else
             if (s->xch_present && !s->xch_disable) {
 #endif
@@ -2614,10 +2612,8 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
 
     /* allow downmixing to stereo */
 #if FF_API_REQUEST_CHANNELS
-FF_DISABLE_DEPRECATION_WARNINGS
     if (avctx->request_channel_layout == 2)
         avctx->request_channel_layout = AV_CH_LAYOUT_STEREO;
-FF_ENABLE_DEPRECATION_WARNINGS
 #endif
     if (avctx->channels > 2 &&
         avctx->request_channel_layout == AV_CH_LAYOUT_STEREO)
-- 
1.9.3 (Apple Git-50)

