$OpenBSD: patch-libavcodec_aacenc_c,v 1.1 2013/08/19 14:38:29 brad Exp $

Fix erasure of surround channels.

--- libavcodec/aacenc.c.orig	Wed Jun 12 19:09:49 2013
+++ libavcodec/aacenc.c	Wed Jun 12 19:10:53 2013
@@ -593,7 +593,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVP
                 coeffs[ch] = cpe->ch[ch].coeffs;
             s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
             for (ch = 0; ch < chans; ch++) {
-                s->cur_channel = start_ch * 2 + ch;
+                s->cur_channel = start_ch + ch;
                 s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
             }
             cpe->common_window = 0;
@@ -609,7 +609,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVP
                     }
                 }
             }
-            s->cur_channel = start_ch * 2;
+            s->cur_channel = start_ch;
             if (s->options.stereo_mode && cpe->common_window) {
                 if (s->options.stereo_mode > 0) {
                     IndividualChannelStream *ics = &cpe->ch[0].ics;
