mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
audioconvert2: remap volumes to right channels
We get the volumes with a channelmap of the input/output, remap this to the channelmixer internal layout.
This commit is contained in:
parent
50c37cc801
commit
9e93fe3c36
1 changed files with 6 additions and 1 deletions
|
|
@ -1147,6 +1147,8 @@ static int remap_volumes(struct impl *this, const struct spa_audio_info *info)
|
||||||
static void set_volume(struct impl *this)
|
static void set_volume(struct impl *this)
|
||||||
{
|
{
|
||||||
struct volumes *vol;
|
struct volumes *vol;
|
||||||
|
uint32_t i;
|
||||||
|
float volumes[SPA_AUDIO_MAX_CHANNELS];
|
||||||
struct dir *dir = &this->dir[this->direction];
|
struct dir *dir = &this->dir[this->direction];
|
||||||
|
|
||||||
if (dir->have_format)
|
if (dir->have_format)
|
||||||
|
|
@ -1160,8 +1162,11 @@ static void set_volume(struct impl *this)
|
||||||
else
|
else
|
||||||
vol = &this->props.channel;
|
vol = &this->props.channel;
|
||||||
|
|
||||||
|
for (i = 0; i < vol->n_volumes; i++)
|
||||||
|
volumes[i] = vol->volumes[dir->src_remap[i]];
|
||||||
|
|
||||||
channelmix_set_volume(&this->mix, this->props.volume, vol->mute,
|
channelmix_set_volume(&this->mix, this->props.volume, vol->mute,
|
||||||
vol->n_volumes, vol->volumes);
|
vol->n_volumes, volumes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int setup_channelmix(struct impl *this)
|
static int setup_channelmix(struct impl *this)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue