[pulseaudio-discuss] [PATCH] "sink_description" option for module-remap-sink

Jan Kasprzak kas at fi.muni.cz
Fri Jan 16 07:02:15 PST 2009


	Hello,

When I split the 8-channel sound card to four independent stereo sinks
(as described in http://pulseaudio.org/wiki/Modules in module-remap-sink),
the new sinks are all visible in pavucontrol under the same label (which is
"Remapped <the original sink name>"), so it is not clear which one
user wants to choose. One possible way is to modify pavucontrol to use
sink names instead of descriptions, the other one is to make description
configurable in module-remap-sink. This patch implements the second approach.
Please consider applying it.

	Thanks,

-Jan Kasprzak

---
 src/modules/module-remap-sink.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index e17fef0..dbbaec7 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -62,6 +62,7 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_description",
     "master",
     "master_channel_map",
     "rate",
@@ -349,8 +350,12 @@ int pa__init(pa_module*m) {
         sink_data.name = pa_sprintf_malloc("%s.remapped", master->name);
     pa_sink_new_data_set_sample_spec(&sink_data, &ss);
     pa_sink_new_data_set_channel_map(&sink_data, &sink_map);
-    k = pa_proplist_gets(master->proplist, PA_PROP_DEVICE_DESCRIPTION);
-    pa_proplist_setf(sink_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Remapped %s", k ? k : master->name);
+    if ((k = pa_modargs_get_value(ma, "sink_description", NULL))) {
+        pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_DESCRIPTION, k);
+    } else {
+        k = pa_proplist_gets(master->proplist, PA_PROP_DEVICE_DESCRIPTION);
+        pa_proplist_setf(sink_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Remapped %s", k ? k : master->name);
+    }
     pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_MASTER_DEVICE, master->name);
     pa_proplist_sets(sink_data.proplist, PA_PROP_DEVICE_CLASS, "filter");
 
-- 
1.6.0.6


-- 
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
>>  If you find yourself arguing with Alan Cox, you’re _probably_ wrong.  <<
>>     --James Morris in "How and Why You Should Become a Kernel Hacker"  <<



More information about the pulseaudio-discuss mailing list