mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
before applying balance/fade check it actually makes sense
This commit is contained in:
parent
f9696c0e7f
commit
554c818d21
2 changed files with 26 additions and 7 deletions
|
|
@ -467,6 +467,9 @@ float pa_cvolume_get_balance(const pa_cvolume *v, const pa_channel_map *map) {
|
|||
pa_assert(map);
|
||||
pa_assert(map->channels == v->channels);
|
||||
|
||||
if (!pa_channel_map_can_balance(map))
|
||||
return 0.0f;
|
||||
|
||||
get_avg_lr(map, v, &left, &right);
|
||||
|
||||
if (left == right)
|
||||
|
|
@ -497,6 +500,9 @@ pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, flo
|
|||
pa_assert(new_balance >= -1.0f);
|
||||
pa_assert(new_balance <= 1.0f);
|
||||
|
||||
if (!pa_channel_map_can_balance(map))
|
||||
return v;
|
||||
|
||||
get_avg_lr(map, v, &left, &right);
|
||||
|
||||
m = PA_MAX(left, right);
|
||||
|
|
@ -584,6 +590,9 @@ float pa_cvolume_get_fade(const pa_cvolume *v, const pa_channel_map *map) {
|
|||
pa_assert(map);
|
||||
pa_assert(map->channels == v->channels);
|
||||
|
||||
if (!pa_channel_map_can_fade(map))
|
||||
return 0.0f;
|
||||
|
||||
get_avg_fr(map, v, &front, &rear);
|
||||
|
||||
if (front == rear)
|
||||
|
|
@ -605,6 +614,9 @@ pa_cvolume* pa_cvolume_set_fade(pa_cvolume *v, const pa_channel_map *map, float
|
|||
pa_assert(new_fade >= -1.0f);
|
||||
pa_assert(new_fade <= 1.0f);
|
||||
|
||||
if (!pa_channel_map_can_fade(map))
|
||||
return v;
|
||||
|
||||
get_avg_fr(map, v, &front, &rear);
|
||||
|
||||
m = PA_MAX(front, rear);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue