mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
don't divide by zero if no left resp. no right channels are defined
This commit is contained in:
parent
67fcc76093
commit
936862362c
1 changed files with 9 additions and 2 deletions
|
|
@ -424,8 +424,15 @@ static void get_avg_lr(const pa_channel_map *map, const pa_cvolume *v, pa_volume
|
|||
}
|
||||
}
|
||||
|
||||
*l = left / n_left;
|
||||
*r = right / n_right;
|
||||
if (n_left <= 0)
|
||||
*l = PA_VOLUME_NORM;
|
||||
else
|
||||
*l = left / n_left;
|
||||
|
||||
if (n_right <= 0)
|
||||
*r = PA_VOLUME_NORM;
|
||||
else
|
||||
*r = right / n_right;
|
||||
}
|
||||
|
||||
float pa_cvolume_get_balance(const pa_channel_map *map, const pa_cvolume *v) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue