diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-04 02:16:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-04 02:16:33 +0100 |
commit | 4b8bc6d2b0a94c850f7d807a7da21804f1f9c1c7 (patch) | |
tree | b1bb3f853c1bb5fdcdc901a47d1be37a78135c03 | |
parent | fadec4f6dbc77b74e5b868ef206ecc560da639fb (diff) | |
parent | fc6a3ef40d34ce8443ae57c2452f3f273d7d4891 (diff) | |
download | ffmpeg-4b8bc6d2b0a94c850f7d807a7da21804f1f9c1c7.tar.gz |
Merge commit 'fc6a3ef40d34ce8443ae57c2452f3f273d7d4891'
* commit 'fc6a3ef40d34ce8443ae57c2452f3f273d7d4891':
audio_mix: fix zeroing output channels in certain cases
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavresample/audio_mix.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c index 878e5a9339..514a7d9125 100644 --- a/libavresample/audio_mix.c +++ b/libavresample/audio_mix.c @@ -559,9 +559,12 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride) if (zero) { am->output_zero[o] = 1; am->out_matrix_channels--; + if (o < am->in_channels) + am->in_matrix_channels--; } } - if (am->out_matrix_channels == 0) { + if (am->out_matrix_channels == 0 || am->in_matrix_channels == 0) { + am->out_matrix_channels = 0; am->in_matrix_channels = 0; return; } @@ -683,7 +686,7 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride) am->in_matrix_channels; \ for (i = 0, i0 = 0; i < am->in_channels; i++) { \ double v; \ - if (am->input_skip[i]) \ + if (am->input_skip[i] || am->output_zero[i]) \ continue; \ v = matrix[o * stride + i]; \ am->matrix_## type[o0][i0] = expr; \ |