make multiplex as boolean module parameter, default value is true 62/26862/3
authorJaska Uimonen <jaska.uimonen@helsinki.fi>
Wed, 20 Aug 2014 09:49:24 +0000 (12:49 +0300)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Fri, 29 Aug 2014 14:14:04 +0000 (17:14 +0300)
Change-Id: Ic884c0664a0f702b9329368dc3743263ce92464c

murphy/discover.c
murphy/module-murphy-ivi.c
murphy/userdata.h

index 9458db1..631d6a4 100644 (file)
@@ -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);
+                    }
                 }
             }
         }
index 2b6667f..895451e 100644 (file)
@@ -88,6 +88,7 @@ PA_MODULE_USAGE(
     "config_file=<policy configuration file> "
     "fade_out=<stream fade-out time in msec> "
     "fade_in=<stream fade-in time in msec> "
+    "enable_multiplex=<boolean for disabling combine creation> "
 #ifdef WITH_DOMCTL
     "murphy_domain_controller=<address of Murphy's domain controller service> "
 #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)
index 06c3cda..b43c82b 100644 (file)
@@ -169,6 +169,7 @@ struct userdata {
     pa_extapi     *extapi;
     pa_native_protocol *protocol;
     pa_murphyif   *murphyif;
+    bool           enable_multiplex;
 };
 
 #endif