From: Lennart Poettering Date: Fri, 3 Oct 2008 15:45:04 +0000 (+0200) Subject: when checking the validity of a cvolume check whether all values are not -1 X-Git-Tag: submit/2.0-panda/20130828.192557~2614 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bde142c237924870e9b09d09d5d2a7186de2e249;p=profile%2Fivi%2Fpulseaudio-panda.git when checking the validity of a cvolume check whether all values are not -1 --- diff --git a/src/pulse/volume.c b/src/pulse/volume.c index e809ef9..0ef02d9 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -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; }