Skip to content

Commit

Permalink
Fix distortion caused by mono filter
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatherly committed Feb 18, 2024
1 parent 0fbe464 commit 299bf23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/core/filter_mono.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static int filter_get_audio(mlt_frame frame,
for (i = 0; i < *samples; i++) {
int32_t mixdown = 0;
for (j = 0; j < *channels; j++)
mixdown += ((int32_t *) *buffer)[(j * *channels) + i];
mixdown += ((int32_t *) *buffer)[(j * *samples) + i];
for (j = 0; j < channels_out; j++)
new_buffer[(j * *samples) + i] = mixdown;
}
Expand All @@ -112,7 +112,7 @@ static int filter_get_audio(mlt_frame frame,
for (i = 0; i < *samples; i++) {
float mixdown = 0;
for (j = 0; j < *channels; j++)
mixdown += ((float *) *buffer)[(j * *channels) + i];
mixdown += ((float *) *buffer)[(j * *samples) + i];
for (j = 0; j < channels_out; j++)
new_buffer[(j * *samples) + i] = mixdown;
}
Expand Down

0 comments on commit 299bf23

Please sign in to comment.