From: Lennart Poettering Date: Sat, 21 Jun 2008 00:28:34 +0000 (+0200) Subject: since the sink is unlinked before the sink input we need to make sure we don't call... X-Git-Tag: submit/2.0-panda/20130828.192557~2846 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9f8b6a5030f9b9ef7cf255eedbe044c97069a19;p=profile%2Fivi%2Fpulseaudio-panda.git since the sink is unlinked before the sink input we need to make sure we don't call any function for unlinked sinks from any sink input callback --- diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c index ca1c05c..d86a72f 100644 --- a/src/modules/module-ladspa-sink.c +++ b/src/modules/module-ladspa-sink.c @@ -260,7 +260,7 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_memblockq_set_maxrewind(u->memblockq, nbytes); @@ -274,7 +274,7 @@ static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_set_max_request(u->sink, nbytes); @@ -287,7 +287,7 @@ static void sink_input_update_sink_latency_range_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_update_latency_range(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency); @@ -300,7 +300,7 @@ static void sink_input_detach_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_detach_within_thread(u->sink); @@ -315,7 +315,7 @@ static void sink_input_attach_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_set_asyncmsgq(u->sink, i->sink->asyncmsgq); diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c index ac39fa1..2c9b6da 100644 --- a/src/modules/module-remap-sink.c +++ b/src/modules/module-remap-sink.c @@ -179,7 +179,7 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_set_max_rewind(u->sink, nbytes); @@ -192,7 +192,7 @@ static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_set_max_request(u->sink, nbytes); @@ -205,7 +205,7 @@ static void sink_input_update_sink_latency_range_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_update_latency_range(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency); @@ -218,7 +218,7 @@ static void sink_input_detach_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_detach_within_thread(u->sink); @@ -233,7 +233,7 @@ static void sink_input_attach_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - if (!u->sink) + if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; pa_sink_set_asyncmsgq(u->sink, i->sink->asyncmsgq);