Logo Search packages:      
Sourcecode: pulseaudio version File versions

int pa_sample_spec_valid ( const pa_sample_spec spec  ) 

Return non-zero when the sample type specification is valid

Definition at line 93 of file sample.c.

References pa_sample_spec::channels, pa_sample_spec::format, PA_CHANNELS_MAX, PA_RATE_MAX, PA_SAMPLE_MAX, and pa_sample_spec::rate.

                                                     {
    pa_assert(spec);

    if (spec->rate <= 0 ||
        spec->rate > PA_RATE_MAX ||
        spec->channels <= 0 ||
        spec->channels > PA_CHANNELS_MAX ||
        spec->format >= PA_SAMPLE_MAX ||
        spec->format < 0)
        return 0;

    return 1;
}


Generated by  Doxygen 1.6.0   Back to index