From: Sangchul Lee Date: Tue, 13 Feb 2018 05:33:20 +0000 (+0900) Subject: filter-apply: Add 'autoclean_interval' module argument X-Git-Tag: accepted/tizen/unified/20180227.062917~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F170052%2F3;p=platform%2Fupstream%2Fpulseaudio.git filter-apply: Add 'autoclean_interval' module argument original patch : 8339a13fd40b519958218660f986947f8290c98c - sc11.lee@samsung.com - 2017-07-05 - filter-apply: Add "autoclean_interval" module argument Now it is possible to set interval time of "autoclean" behavior. Deafult time is 10 seconds which is the same as before. [Version] 11.1-20 [Issue Type] Tizen modification Signed-off-by: Sangchul Lee Change-Id: I340ff5d35afbe00cf49930e88938a2bc1a9d3b5c --- diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index 01d0feb..86c6cf2 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -3,7 +3,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 11.1 -Release: 19 +Release: 20 Group: Multimedia/Audio License: LGPL-2.1 URL: http://pulseaudio.org diff --git a/src/modules/module-filter-apply.c b/src/modules/module-filter-apply.c index 3c92e0e..646a2f4 100644 --- a/src/modules/module-filter-apply.c +++ b/src/modules/module-filter-apply.c @@ -49,15 +49,28 @@ PA_MODULE_AUTHOR("Colin Guthrie"); PA_MODULE_DESCRIPTION("Load filter sinks automatically when needed"); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(true); +#ifdef __TIZEN__ +PA_MODULE_USAGE( + _("autoclean=" + "autoclean_interval=")); +#else PA_MODULE_USAGE(_("autoclean=")); +#endif static const char* const valid_modargs[] = { "autoclean", +#ifdef __TIZEN__ + "autoclean_interval", +#endif NULL }; #define DEFAULT_AUTOCLEAN true +#ifdef __TIZEN__ +#define DEFAULT_AUTOCLEAN_INTERVAL 10 +#else #define HOUSEKEEPING_INTERVAL (10 * PA_USEC_PER_SEC) +#endif struct filter { char *name; @@ -80,6 +93,9 @@ struct userdata { * pa_sink_input/pa_source_output. */ pa_hashmap *mdm_ignored_inputs, *mdm_ignored_outputs; bool autoclean; +#ifdef __TIZEN__ + uint32_t autoclean_interval; +#endif pa_time_event *housekeeping_time_event; }; @@ -395,6 +411,13 @@ static void housekeeping_time_callback(pa_mainloop_api*a, pa_time_event* e, cons pa_log_info("Housekeeping Done."); } +#ifdef __TIZEN__ +static pa_usec_t get_housekeeping_interval(struct userdata *u) { + pa_assert(u); + + return u->autoclean_interval * PA_USEC_PER_SEC; +} +#endif static void trigger_housekeeping(struct userdata *u) { pa_assert(u); @@ -404,7 +427,11 @@ static void trigger_housekeeping(struct userdata *u) { if (u->housekeeping_time_event) return; +#ifdef __TIZEN__ + u->housekeeping_time_event = pa_core_rttime_new(u->core, pa_rtclock_now() + get_housekeeping_interval(u), housekeeping_time_callback, u); +#else u->housekeeping_time_event = pa_core_rttime_new(u->core, pa_rtclock_now() + HOUSEKEEPING_INTERVAL, housekeeping_time_callback, u); +#endif } static int do_move(struct userdata *u, pa_object *obj, pa_object *parent, bool is_input) { @@ -893,6 +920,13 @@ int pa__init(pa_module *m) { pa_log("Failed to parse autoclean value"); goto fail; } +#ifdef __TIZEN__ + u->autoclean_interval = DEFAULT_AUTOCLEAN_INTERVAL; + if (pa_modargs_get_value_u32(ma, "autoclean_interval", &u->autoclean_interval) < 0) { + pa_log("Failed to parse autoclean_interval value"); + goto fail; + } +#endif u->filters = pa_hashmap_new(filter_hash, filter_compare); u->mdm_ignored_inputs = pa_hashmap_new_full(NULL, NULL, (pa_free_cb_t) unset_mdm_ignore_input, NULL);