Logo Search packages:      
Sourcecode: pulseaudio version File versions

int pa_cvolume_valid ( const pa_cvolume v  ) 

Return TRUE when the passed cvolume structure is valid, FALSE otherwise

Definition at line 255 of file volume.c.

References pa_cvolume::channels, PA_CHANNELS_MAX, pa_volume_t, and pa_cvolume::values.

                                          {
    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;
}


Generated by  Doxygen 1.6.0   Back to index