From b76d835e590b8aa10d724c857ea7d135ba53d94e Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Sun, 27 Dec 2020 15:25:40 +0300 Subject: [PATCH] ladspa-sink: do not call pa_sink_suspend if PA_SINK_IS_LINKED is false While module-ladspa-sink is still being loaded and before pa_sink_put() is called there may be an attempt to reconfigure master sink when avoid-resampling is true. This breaks attempting to suspend ladspa-sink which is still in INIT state. Fix this by skipping pa_sink_suspend if PA_SINK_IS_LINKED is false. Part-of: --- src/modules/module-ladspa-sink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c index f4fed6d64..5726d0818 100644 --- a/src/modules/module-ladspa-sink.c +++ b/src/modules/module-ladspa-sink.c @@ -714,6 +714,9 @@ static void sink_input_suspend_cb(pa_sink_input *i, pa_sink_state_t old_state, p pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); + if (!PA_SINK_IS_LINKED(u->sink->state)) + return; + if (i->sink->state != PA_SINK_SUSPENDED || i->sink->suspend_cause == PA_SUSPEND_IDLE) pa_sink_suspend(u->sink, false, PA_SUSPEND_UNAVAILABLE); else