+ if( id->f_src.audio.i_channels !=
+ id->p_encoder->fmt_in.audio.i_channels )
+ {
+ unsigned int i;
+ int j;
+
+ /* This is for liba52 which is what ffmpeg uses to decode ac3 */
+ static const int translation[7][6] =
+ {{ 0, 0, 0, 0, 0, 0 }, /* 0 channels (rarely used) */
+ { 0, 0, 0, 0, 0, 0 }, /* 1 ch */
+ { 0, 1, 0, 0, 0, 0 }, /* 2 */
+ { 1, 2, 0, 0, 0, 0 }, /* 3 */
+ { 1, 3, 2, 0, 0, 0 }, /* 4 */
+ { 1, 3, 4, 2, 0, 0 }, /* 5 */
+ { 1, 3, 4, 5, 2, 0 }}; /* 6 */
+
+ /* dumb downmixing */
+ for( i = 0; i < aout_buf.i_nb_samples; i++ )