[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-234-g8fe50b0

Lennart Poettering gitmailer-noreply at 0pointer.de
Thu Jun 18 05:37:26 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  ca560ccc4a562c7a2a477331b72e7c62adf21a95 (commit)

- Log -----------------------------------------------------------------
8fe50b0 alsa,core: include mapping name in description strings
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa/alsa-util.c |   21 ++++++++++++---------
 src/pulsecore/sink.c         |   35 ++++++++++++++++++++---------------
 2 files changed, 32 insertions(+), 24 deletions(-)

-----------------------------------------------------------------------

commit 8fe50b0d7cd4a93be85887bdb7efd2663face50d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Jun 18 04:38:59 2009 +0200

    alsa,core: include mapping name in description strings

diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 0204c28..0ed4361 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -752,21 +752,24 @@ void pa_alsa_redirect_errors_dec(void) {
 }
 
 pa_bool_t pa_alsa_init_description(pa_proplist *p) {
-    const char *s;
+    const char *d, *k;
     pa_assert(p);
 
     if (pa_device_init_description(p))
         return TRUE;
 
-    if ((s = pa_proplist_gets(p, "alsa.card_name"))) {
-        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
-        return TRUE;
-    }
+    if (!(d = pa_proplist_gets(p, "alsa.card_name")))
+        d = pa_proplist_gets(p, "alsa.name");
 
-    if ((s = pa_proplist_gets(p, "alsa.name"))) {
-        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
-        return TRUE;
-    }
+    if (!d)
+        return FALSE;
+
+    k = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_DESCRIPTION);
+
+    if (d && k)
+        pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, _("%s %s"), d, k);
+    else if (d)
+        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, d);
 
     return FALSE;
 }
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 7e4513e..d8f3c7d 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -2384,30 +2384,35 @@ pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
 }
 
 pa_bool_t pa_device_init_description(pa_proplist *p) {
-    const char *s;
+    const char *s, *d = NULL, *k;
     pa_assert(p);
 
     if (pa_proplist_contains(p, PA_PROP_DEVICE_DESCRIPTION))
         return TRUE;
 
     if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR)))
-        if (pa_streq(s, "internal")) {
-            pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Internal Audio"));
-            return TRUE;
-        }
+        if (pa_streq(s, "internal"))
+            d = _("Internal Audio");
 
-    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
-        if (pa_streq(s, "modem")) {
-            pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Modem"));
-            return TRUE;
-        }
+    if (!d)
+        if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
+            if (pa_streq(s, "modem"))
+                d = _("Modem");
 
-    if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME))) {
-        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
-        return TRUE;
-    }
+    if (!d)
+        d = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME);
 
-    return FALSE;
+    if (!d)
+        return FALSE;
+
+    k = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_DESCRIPTION);
+
+    if (d && k)
+        pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, _("%s %s"), d, k);
+    else if (d)
+        pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, d);
+
+    return TRUE;
 }
 
 pa_bool_t pa_device_init_intended_roles(pa_proplist *p) {

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list