mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
when checking the validity of a cvolume check whether all values are not -1
This commit is contained in:
parent
c0a9e8bfb7
commit
bde142c237
1 changed files with 6 additions and 0 deletions
|
|
@ -233,11 +233,17 @@ pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const
|
|||
}
|
||||
|
||||
int pa_cvolume_valid(const pa_cvolume *v) {
|
||||
unsigned c;
|
||||
|
||||
pa_assert(v);
|
||||
|
||||
if (v->channels <= 0 || v->channels > PA_CHANNELS_MAX)
|
||||
return 0;
|
||||
|
||||
for (c = 0; c < v->channels; c++)
|
||||
if (v->values[c] == (pa_volume_t) -1)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue