mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
properly deal with the case when l/r is silent when adjust balance
This commit is contained in:
parent
47a9b96b64
commit
634afede7d
1 changed files with 2 additions and 2 deletions
|
|
@ -487,12 +487,12 @@ pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, flo
|
|||
for (c = 0; c < map->channels; c++) {
|
||||
if (on_left(map->map[c])) {
|
||||
if (left == 0)
|
||||
v->values[c] = 0;
|
||||
v->values[c] = nleft;
|
||||
else
|
||||
v->values[c] = (pa_volume_t) (((uint64_t) v->values[c] * (uint64_t) nleft) / (uint64_t) left);
|
||||
} else if (on_right(map->map[c])) {
|
||||
if (right == 0)
|
||||
v->values[c] = 0;
|
||||
v->values[c] = nright;
|
||||
else
|
||||
v->values[c] = (pa_volume_t) (((uint64_t) v->values[c] * (uint64_t) nright) / (uint64_t) right);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue