mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
don't access i->sink if it is not set
This commit is contained in:
parent
d9b19f870c
commit
c2f6d090c7
2 changed files with 10 additions and 6 deletions
|
|
@ -845,10 +845,12 @@ pa_usec_t pa_sink_input_set_requested_latency(pa_sink_input *i, pa_usec_t usec)
|
|||
/* 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue