/* If this sink input is not realized yet or we are being moved,
* we have to touch the thread info data directly */
- pa_sink_get_latency_range(i->sink, &min_latency, &max_latency);
+ if (i->sink) {
+ pa_sink_get_latency_range(i->sink, &min_latency, &max_latency);
- if (usec != (pa_usec_t) -1)
- usec = PA_CLAMP(usec, min_latency, max_latency);
+ if (usec != (pa_usec_t) -1)
+ usec = PA_CLAMP(usec, min_latency, max_latency);
+ }
i->thread_info.requested_sink_latency = usec;
/* If this source output is not realized yet or is being moved, we
* have to touch the thread info data directly */
- pa_source_get_latency_range(o->source, &min_latency, &max_latency);
+ if (o->source) {
+ pa_source_get_latency_range(o->source, &min_latency, &max_latency);
- if (usec != (pa_usec_t) -1)
- usec = PA_CLAMP(usec, min_latency, max_latency);
+ if (usec != (pa_usec_t) -1)
+ usec = PA_CLAMP(usec, min_latency, max_latency);
+ }
o->thread_info.requested_source_latency = usec;