aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Walker <tdskywalker@gmail.com>2014-01-15 00:18:19 +0000
committerTim Walker <tdskywalker@gmail.com>2014-02-08 13:42:55 +0100
commit76a75c523cd3c63560185394a0a5cd7249db962a (patch)
treefa2177811fc6aa55fa1fb7d75034e4a155f23704
parentc0c45188e56cfa3050bb39f8299025345b8a204c (diff)
downloadffmpeg-76a75c523cd3c63560185394a0a5cd7249db962a.tar.gz
lavr: mix front center channel as indicated in the ATSC A/52 specification.
When mixing 3 front channels into 2, the center channel is mixed into left and right with the center mix level, not -3dB.
-rw-r--r--libavresample/audio_mix_matrix.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavresample/audio_mix_matrix.c b/libavresample/audio_mix_matrix.c
index 8da1b487a4..487869b5fd 100644
--- a/libavresample/audio_mix_matrix.c
+++ b/libavresample/audio_mix_matrix.c
@@ -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;
}