[PATCH] filter-apply: Eliminate nested and redundant hook events.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18.05.2017 03:45, KimJeongYeon wrote:
> Hook events of proplist triggered by pa_{sink_input|source_output}_set_property()
> in do_move() function. Then, do_move() will be called again by its nested hook events.
>
> For example playback stream,
> filter-apply calls do_move() by hook event of 'PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED'
> when sink-input appends "filter.apply" property and trigger hook.
> Then, same hook event triggeres again by pa_sink_input_set_property() in do_move().
> Therefore, duplaicated move operation happens.
>
> This patch eliminate nested and redundant hook events while stream moving by filter-apply.
>
> Signed-off-by: KimJeongYeon <jeongyeon.kim at samsung.com>
> ---
>   src/modules/module-filter-apply.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/src/modules/module-filter-apply.c b/src/modules/module-filter-apply.c
> index 6ca062b..cc508e0 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 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 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);
>   }
>   

Thanks, I amended the commit message and pushed the patch. Sorry for the
long delay.



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux