From bca5499d9c71878fcc9936958c788eef0d2e24b4 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Wed, 20 Aug 2014 12:49:24 +0300 Subject: [PATCH] make multiplex as boolean module parameter, default value is true Change-Id: Ic884c0664a0f702b9329368dc3743263ce92464c --- murphy/discover.c | 18 ++++++++++-------- murphy/module-murphy-ivi.c | 9 +++++++++ murphy/userdata.h | 1 + 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/murphy/discover.c b/murphy/discover.c index 9458db1..631d6a4 100644 --- a/murphy/discover.c +++ b/murphy/discover.c @@ -2265,14 +2265,16 @@ static pa_sink *make_output_prerouting(struct userdata *u, if (!(sink = pa_idxset_get_by_index(core->sinks, target->paidx))) pa_log("no route to default '%s': sink is gone", target->amname); else { - if (pa_classify_multiplex_stream(data)) { - data->mux = pa_multiplex_create(u->multiplex, core, - sink->index, chmap, NULL, - media_role, data->type); - if (data->mux) { - sink = pa_idxset_get_by_index(core->sinks, - data->mux->sink_index); - pa_assert(sink); + if (u->enable_multiplex == true) { + if (pa_classify_multiplex_stream(data)) { + data->mux = pa_multiplex_create(u->multiplex, core, + sink->index, chmap, NULL, + media_role, data->type); + if (data->mux) { + sink = pa_idxset_get_by_index(core->sinks, + data->mux->sink_index); + pa_assert(sink); + } } } } diff --git a/murphy/module-murphy-ivi.c b/murphy/module-murphy-ivi.c index 2b6667f..895451e 100644 --- a/murphy/module-murphy-ivi.c +++ b/murphy/module-murphy-ivi.c @@ -88,6 +88,7 @@ PA_MODULE_USAGE( "config_file= " "fade_out= " "fade_in= " + "enable_multiplex= " #ifdef WITH_DOMCTL "murphy_domain_controller=
" #endif @@ -114,6 +115,7 @@ static const char* const valid_modargs[] = { "config_file", "fade_out", "fade_in", + "enable_multiplex", #ifdef WITH_DOMCTL "murphy_domain_controller", #endif @@ -165,6 +167,7 @@ int pa__init(pa_module *m) { const char *nsnam; const char *cfgpath; char buf[4096]; + bool enable_multiplex = true; pa_assert(m); @@ -178,6 +181,10 @@ int pa__init(pa_module *m) { cfgfile = pa_modargs_get_value(ma, "config_file", DEFAULT_CONFIG_FILE); fadeout = pa_modargs_get_value(ma, "fade_out", NULL); fadein = pa_modargs_get_value(ma, "fade_in", NULL); + + if (pa_modargs_get_value_boolean(ma, "enable_multiplex", &enable_multiplex) < 0) + enable_multiplex = true; + #ifdef WITH_DOMCTL ctladdr = pa_modargs_get_value(ma, "murphy_domain_controller", NULL); #endif @@ -226,6 +233,8 @@ int pa__init(pa_module *m) { u->state.sink = PA_IDXSET_INVALID; u->state.source = PA_IDXSET_INVALID; + u->enable_multiplex = enable_multiplex; + if (u->nullsink == NULL || u->routerif == NULL || u->audiomgr == NULL || u->discover == NULL || u->murphyif == NULL) diff --git a/murphy/userdata.h b/murphy/userdata.h index 06c3cda..b43c82b 100644 --- a/murphy/userdata.h +++ b/murphy/userdata.h @@ -169,6 +169,7 @@ struct userdata { pa_extapi *extapi; pa_native_protocol *protocol; pa_murphyif *murphyif; + bool enable_multiplex; }; #endif -- 2.7.4