Merge commit '76a75c523cd3c63560185394a0a5cd7249db962a'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 8 Feb 2014 17:20:16 +0000 (18:20 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 8 Feb 2014 17:38:17 +0000 (18:38 +0100)
* commit '76a75c523cd3c63560185394a0a5cd7249db962a':
  lavr: mix front center channel as indicated in the ATSC A/52 specification.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavresample/audio_mix_matrix.c

index 935ed5a..bcbe181 100644 (file)
@@ -126,8 +126,13 @@ int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout,
     /* mix front center to front left/right */
     if (unaccounted & AV_CH_FRONT_CENTER) {
         if ((out_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
-            matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2;
-            matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2;
+            if ((in_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) {
+                matrix[FRONT_LEFT ][FRONT_CENTER] += center_mix_level;
+                matrix[FRONT_RIGHT][FRONT_CENTER] += center_mix_level;
+            } else {
+                matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2;
+                matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2;
+            }
         } else
             return AVERROR_PATCHWELCOME;
     }