summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor V. Kovalenko <igor.v.kovalenko@gmail.com>2020-12-27 15:25:40 +0300
committerArun Raghavan <arun@asymptotic.io>2021-01-07 19:18:48 -0500
commit80474384f522a790b3a69c998ceb5a08072005c4 (patch)
tree246bfcb1ceef4a6e53710fa24a2d249bf0045027
parent72b6d24adb4fcf47850c66250aca4de904146122 (diff)
downloadpulseaudio-80474384f522a790b3a69c998ceb5a08072005c4.tar.gz
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: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/445>
-rw-r--r--src/modules/module-ladspa-sink.c3
1 files changed, 3 insertions, 0 deletions
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