don't access i->sink if it is not set

This commit is contained in:
Lennart Poettering 2009-04-01 03:03:20 +02:00
parent d9b19f870c
commit c2f6d090c7
2 changed files with 10 additions and 6 deletions

View file

@ -542,10 +542,12 @@ pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t
/* 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;