summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorKimJeongYeon <jeongyeon.kim@samsung.com>2017-12-09 21:00:20 +0100
committerGeorg Chini <georg@chini.tk>2017-12-09 21:23:27 +0100
commit922f08b7872207d958d2b87726b096f02f594943 (patch)
tree9570a9ebaaaa419bcabe159b6992d58c28d53cd6 /src/modules
parente29068067a91eb6d8ed0041692e2a9b343587084 (diff)
downloadpulseaudio-922f08b7872207d958d2b87726b096f02f594943.tar.gz
filter-apply: Eliminate nested and redundant hook events
In proces(), the do_move() function calls pa_{sink_input,source_output}_set_property(). This triggers a call to {sink_input,source_output}_proplist_cb() which called process() a second time. This patch avoids the duplicate and nested call to process() by checking if PA_PROP_FILTER_APPLY_MOVING is set in {sink_input,source_output}_proplist_cb().
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-filter-apply.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/module-filter-apply.c b/src/modules/module-filter-apply.c
index 6d4475dd1..11d134219 100644
--- a/src/modules/module-filter-apply.c
+++ b/src/modules/module-filter-apply.c
@@ -646,6 +646,11 @@ static pa_hook_result_t sink_input_proplist_cb(pa_core *core, pa_sink_input *i,
pa_core_assert_ref(core);
pa_sink_input_assert_ref(i);
+ /* Eliminate nested and redundant hook event that is triggered by
+ pa_sink_input_set_property() in do_move(). */
+ if (pa_proplist_gets(i->proplist, PA_PROP_FILTER_APPLY_MOVING))
+ return PA_HOOK_OK;
+
return process(u, PA_OBJECT(i), true, true);
}
@@ -723,6 +728,11 @@ static pa_hook_result_t source_output_proplist_cb(pa_core *core, pa_source_outpu
pa_core_assert_ref(core);
pa_source_output_assert_ref(o);
+ /* Eliminate nested and redundant hook event that is triggered by
+ pa_source_output_set_property() in do_move(). */
+ if (pa_proplist_gets(o->proplist, PA_PROP_FILTER_APPLY_MOVING))
+ return PA_HOOK_OK;
+
return process(u, PA_OBJECT(o), false, true);
}