channelmix: Only filter FC/LFE when present

This commit is contained in:
Wim Taymans 2022-09-05 13:22:00 +02:00
parent 7b432aec88
commit 0c47ab76a7
2 changed files with 5 additions and 2 deletions

View file

@ -1255,7 +1255,7 @@ static void set_volume(struct impl *this)
float volumes[SPA_AUDIO_MAX_CHANNELS];
struct dir *dir = &this->dir[this->direction];
spa_log_debug(this->log, "%p", this);
spa_log_debug(this->log, "%p have_format:%d", this, dir->have_format);
if (dir->have_format)
remap_volumes(this, &dir->format);

View file

@ -199,8 +199,11 @@ static int make_matrix(struct channelmix *mix)
for (i = 0; i < SPA_AUDIO_MAX_CHANNELS; i++)
matrix[i][i]= 1.0f;
}
if (dst_mask & FRONT)
filter_fc = true;
if (dst_mask & _MASK(LFE))
filter_lfe = true;
src_mask = dst_mask = ~0LU;
filter_fc = filter_lfe = true;
goto done;
} else {
spa_log_debug(mix->log, "matching channels");