]> code.delx.au - pulseaudio/commitdiff
use the sink description instead of the name to choose the description for the monito...
authorLennart Poettering <lennart@poettering.net>
Sun, 20 Apr 2008 21:49:05 +0000 (21:49 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 20 Apr 2008 21:49:05 +0000 (21:49 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2286 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/pulsecore/sink.c

index 39468f1e1f4725ccbfdefd29a6308d39396b1eee..34fb7ae9929f4b72dd7acda5d3a6057051287eda 100644 (file)
@@ -124,10 +124,10 @@ pa_sink* pa_sink_new(
         pa_sink_flags_t flags) {
 
     pa_sink *s;
-    char *d;
     const char *name;
     char st[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
     pa_source_new_data source_data;
+    const char *dn;
 
     pa_assert(core);
     pa_assert(data);
@@ -235,9 +235,8 @@ pa_sink* pa_sink_new(
     source_data.driver = data->driver;
     source_data.module = data->module;
 
-    d = pa_sprintf_malloc("Monitor Source of %s", s->name);
-    pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_DESCRIPTION, d);
-    pa_xfree(d);
+    dn = pa_proplist_gets(s->proplist, PA_PROP_DEVICE_DESCRIPTION);
+    pa_proplist_setf(source_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Monitor Source of %s", dn ? dn : s->name);
     pa_proplist_sets(source_data.proplist, PA_PROP_DEVICE_CLASS, "monitor");
 
     s->monitor_source = pa_source_new(core, &source_data, 0);