[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.17-56-g8ad8e39

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Sep 18 13:42:46 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  1d19d6b878397824dc2d189ef98f18b0a1ffc029 (commit)

- Log -----------------------------------------------------------------
8ad8e39 namereg: choose default sink/source as soon as one becomes available
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/namereg.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

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

commit 8ad8e393f135f294942347dd66ec5e6c53329764
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Sep 18 22:42:37 2009 +0200

    namereg: choose default sink/source as soon as one becomes available

diff --git a/src/pulsecore/namereg.c b/src/pulsecore/namereg.c
index 3775577..d982187 100644
--- a/src/pulsecore/namereg.c
+++ b/src/pulsecore/namereg.c
@@ -98,7 +98,7 @@ char* pa_namereg_make_valid_name(const char *name) {
     if (*name == 0)
         return NULL;
 
-    n = pa_xmalloc(strlen(name)+1);
+    n = pa_xnew(char, strlen(name)+1);
 
     for (a = name, b = n; *a && (a-name < PA_NAME_MAX); a++, b++)
         *b = (char) (is_valid_char(*a) ? *a : '_');
@@ -170,6 +170,17 @@ const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t
 
     pa_assert_se(pa_hashmap_put(c->namereg, e->name, e) >= 0);
 
+    /* If a sink or source is registered and there was none registered
+     * before we inform the clients which then can ask for the default
+     * sink/source which is then assigned. We don't adjust the default
+     * sink/source here right away to give the module the chance to
+     * register more sinks/sources before we choose a new default
+     * sink/source. */
+
+    if ((!c->default_sink && type == PA_NAMEREG_SINK) ||
+        (!c->default_source && type == PA_NAMEREG_SOURCE))
+        pa_subscription_post(c, PA_SUBSCRIPTION_EVENT_SERVER|PA_SUBSCRIPTION_EVENT_CHANGE, PA_INVALID_INDEX);
+
     return e->name;
 }
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list