if (pa_atou(e, &ms) < 0 || ms <= 0)
pa_log_debug("Failed to parse $PULSE_LATENCY_MSEC: %s", e);
+ else if (!pa_sample_spec_valid(&s->sample_spec))
+ pa_log_debug("Ignoring $PULSE_LATENCY_MSEC: %s (invalid sample spec)", e);
else {
attr->maxlength = (uint32_t) -1;
attr->tlength = pa_usec_to_bytes(ms * PA_USEC_PER_MSEC, &s->sample_spec);
attr->minreq = (uint32_t) -1;
attr->prebuf = (uint32_t) -1;
attr->fragsize = attr->tlength;
- }
- if (flags)
- *flags |= PA_STREAM_ADJUST_LATENCY;
+ if (flags)
+ *flags |= PA_STREAM_ADJUST_LATENCY;
+ }
}
if (s->context->version >= 13)