Beispiel #1
0
APULSE_EXPORT
int
pa_sample_spec_valid(const pa_sample_spec *spec)
{
    return spec && pa_sample_format_valid(spec->format)
                && pa_sample_rate_valid(spec->rate)
                && pa_channels_valid(spec->channels);
}
Beispiel #2
0
static int parse_alternate_sample_rate(pa_config_parser_state *state) {
    pa_daemon_conf *c;
    uint32_t r;

    pa_assert(state);

    c = state->data;

    if (pa_atou(state->rvalue, &r) < 0 || !pa_sample_rate_valid(r)) {
        pa_log(_("[%s:%u] Invalid sample rate '%s'."), state->filename, state->lineno, state->rvalue);
        return -1;
    }

    c->alternate_sample_rate = r;
    return 0;
}