Merge commit 'fc6a3ef40d34ce8443ae57c2452f3f273d7d4891'

* commit 'fc6a3ef40d34ce8443ae57c2452f3f273d7d4891':
  audio_mix: fix zeroing output channels in certain cases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/53/head
Michael Niedermayer 11 years ago
commit 4b8bc6d2b0
  1. 7
      libavresample/audio_mix.c

@ -559,9 +559,12 @@ static void reduce_matrix(AudioMix *am, const double *matrix, int stride)
if (zero) { if (zero) {
am->output_zero[o] = 1; am->output_zero[o] = 1;
am->out_matrix_channels--; 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; am->in_matrix_channels = 0;
return; return;
} }
@ -683,7 +686,7 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
am->in_matrix_channels; \ am->in_matrix_channels; \
for (i = 0, i0 = 0; i < am->in_channels; i++) { \ for (i = 0, i0 = 0; i < am->in_channels; i++) { \
double v; \ double v; \
if (am->input_skip[i]) \ if (am->input_skip[i] || am->output_zero[i]) \
continue; \ continue; \
v = matrix[o * stride + i]; \ v = matrix[o * stride + i]; \
am->matrix_## type[o0][i0] = expr; \ am->matrix_## type[o0][i0] = expr; \

Loading…
Cancel
Save