[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-230-g3d631df

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Jan 13 07:35:41 PST 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  f6ac7b4ed6ad2d4f10def0f5657e25692bcb2e2b (commit)

- Log -----------------------------------------------------------------
3d631df... build: print more informations about preopen
9d6e9f5... cli: update-sink-proplist
01f71ac... libpulse: add proplist_from_string
9e978c9... core: report remaining shared objects when cleanup
ebb903a... core: add pa_source_update_proplist
9444347... core: add pa_sink_update_proplist
-----------------------------------------------------------------------

Summary of changes:
 configure.ac                |    8 +++-
 src/map-file                |    1 +
 src/pulse/proplist.c        |   84 +++++++++++++++++++++++++++++++++++++++++++
 src/pulse/proplist.h        |    6 +++-
 src/pulsecore/cli-command.c |   36 ++++++++++++++++++-
 src/pulsecore/shared.c      |    9 ++++-
 src/pulsecore/sink.c        |   14 +++++++
 src/pulsecore/sink.h        |    2 +
 src/pulsecore/source.c      |   14 +++++++
 src/pulsecore/source.h      |    2 +
 src/tests/proplist-test.c   |   11 +++++-
 11 files changed, 180 insertions(+), 7 deletions(-)

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

commit 9444347c061f271ac74d550b5f3f4b7a803a26d6
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Fri Oct 31 02:33:28 2008 +0200

    core: add pa_sink_update_proplist

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index a4d993c..d5082d5 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -953,6 +953,20 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
     return s->muted;
 }
 
+pa_bool_t pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode, pa_proplist *p) {
+
+    pa_sink_assert_ref(s);
+
+    pa_proplist_update(s->proplist, mode, p);
+
+    if (PA_SINK_IS_LINKED(s->state)) {
+        pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_PROPLIST_CHANGED], s);
+        pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+    }
+
+    return TRUE;
+}
+
 /* Called from main thread */
 void pa_sink_set_description(pa_sink *s, const char *description) {
     const char *old;
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index 254be3b..092e30f 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -252,6 +252,8 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *sink, pa_bool_t force_refresh);
 void pa_sink_set_mute(pa_sink *sink, pa_bool_t mute);
 pa_bool_t pa_sink_get_mute(pa_sink *sink, pa_bool_t force_refres);
 
+pa_bool_t pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode, pa_proplist *p);
+
 unsigned pa_sink_linked_by(pa_sink *s); /* Number of connected streams */
 unsigned pa_sink_used_by(pa_sink *s); /* Number of connected streams which are not corked */
 unsigned pa_sink_check_suspend(pa_sink *s); /* Returns how many streams are active that don't allow suspensions */

commit ebb903a37697430f7e2d1ca5314ca23e922a3411
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Fri Oct 31 02:38:00 2008 +0200

    core: add pa_source_update_proplist

diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 815ec27..e65c5ce 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -604,6 +604,20 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
     return s->muted;
 }
 
+pa_bool_t pa_source_update_proplist(pa_source *s, pa_update_mode_t mode, pa_proplist *p) {
+
+    pa_source_assert_ref(s);
+
+    pa_proplist_update(s->proplist, mode, p);
+
+    if (PA_SOURCE_IS_LINKED(s->state)) {
+        pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED], s);
+        pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+    }
+
+    return TRUE;
+}
+
 /* Called from main thread */
 void pa_source_set_description(pa_source *s, const char *description) {
     const char *old;
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index b93e4ad..fd8c4bd 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -234,6 +234,8 @@ const pa_cvolume *pa_source_get_volume(pa_source *source, pa_bool_t force_refres
 void pa_source_set_mute(pa_source *source, pa_bool_t mute);
 pa_bool_t pa_source_get_mute(pa_source *source, pa_bool_t force_refresh);
 
+pa_bool_t pa_source_update_proplist(pa_source *s, pa_update_mode_t mode, pa_proplist *p);
+
 unsigned pa_source_linked_by(pa_source *s); /* Number of connected streams */
 unsigned pa_source_used_by(pa_source *s); /* Number of connected streams that are not corked */
 unsigned pa_source_check_suspend(pa_source *s); /* Returns how many streams are active that don't allow suspensions */

commit 9e978c97702ef199764671b68def5c0e42a32250
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Thu Dec 4 16:23:06 2008 +0200

    core: report remaining shared objects when cleanup

diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
index 77d919d..4c1ad80 100644
--- a/src/pulsecore/shared.c
+++ b/src/pulsecore/shared.c
@@ -111,7 +111,14 @@ void pa_shared_cleanup(pa_core *c) {
     if (!c->shared)
         return;
 
-    pa_assert(pa_hashmap_isempty(c->shared));
+    if (!pa_hashmap_isempty(c->shared)) {
+        pa_strbuf *s = pa_strbuf_new();
+
+        pa_shared_dump(c, s);
+        pa_log_debug(pa_strbuf_tostring(s));
+        pa_strbuf_free(s);
+        pa_assert(pa_hashmap_isempty(c->shared));
+    }
 
     pa_hashmap_free(c->shared, NULL, NULL);
     c->shared = NULL;

commit 01f71ac7a1fc2cb2f7b29e563a3468c2ffe05313
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Oct 27 21:14:50 2008 +0200

    libpulse: add proplist_from_string

diff --git a/src/map-file b/src/map-file
index 82b9c38..59006fe 100644
--- a/src/map-file
+++ b/src/map-file
@@ -156,6 +156,7 @@ pa_proplist_set;
 pa_proplist_setf;
 pa_proplist_sets;
 pa_proplist_to_string;
+pa_proplist_from_string;
 pa_proplist_unset;
 pa_proplist_unset_many;
 pa_proplist_update;
diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c
index 93bc003..1694284 100644
--- a/src/pulse/proplist.c
+++ b/src/pulse/proplist.c
@@ -291,6 +291,90 @@ char *pa_proplist_to_string(pa_proplist *p) {
     return pa_strbuf_tostring_free(buf);
 }
 
+/* Remove all whitepsapce from the beginning and the end of *s. *s may
+ * be modified. (from conf-parser.c) */
+#define WHITESPACE " \t\n"
+#define in_string(c,s) (strchr(s,c) != NULL)
+
+static char *strip(char *s) {
+    char *b = s+strspn(s, WHITESPACE);
+    char *e, *l = NULL;
+
+    for (e = b; *e; e++)
+        if (!in_string(*e, WHITESPACE))
+            l = e;
+
+    if (l)
+        *(l+1) = 0;
+
+    return b;
+}
+
+pa_proplist *pa_proplist_from_string(const char *str) {
+    pa_proplist *p;
+    char *s, *v, *k, *e;
+
+    pa_assert(str);
+    pa_assert_se(p = pa_proplist_new());
+    pa_assert_se(s = strdup(str));
+
+    for (k = s; *k; k = e) {
+        k = k+strspn(k, WHITESPACE);
+
+        if (!*k)
+            break;
+
+        if (!(v = strchr(k, '='))) {
+            pa_log("Missing '='.");
+            break;
+        }
+
+        *v++ = '\0';
+        k = strip(k);
+
+        v = v+strspn(v, WHITESPACE);
+        if (*v == '"') {
+            v++;
+            if (!(e = strchr(v, '"'))) { /* FIXME: handle escape */
+                pa_log("Missing '\"' at end of string value.");
+                break;
+            }
+            *e++ = '\0';
+            pa_proplist_sets(p, k, v);
+        } else {
+            uint8_t *blob;
+
+            if (*v++ != 'h' || *v++ != 'e' || *v++ != 'x' || *v++ != ':') {
+                pa_log("Value must be a string or \"hex:\"");
+                break;
+            }
+
+            e = v;
+            while (in_string(*e, "0123456789abcdefABCDEF"))
+                ++e;
+
+            if ((e - v) % 2) {
+                pa_log("Invalid \"hex:\" value data");
+                break;
+            }
+
+            blob = pa_xmalloc((size_t)(e-v)/2);
+            if (pa_parsehex(v, blob, (e-v)/2) != ((e-v)/2)) {
+                pa_log("Invalid \"hex:\" value data");
+                pa_xfree(blob);
+                break;
+            }
+
+            pa_proplist_set(p, k, blob, (e-v)/2);
+            pa_xfree(blob);
+        }
+    }
+
+    pa_xfree(s);
+
+    return p;
+}
+
 int pa_proplist_contains(pa_proplist *p, const char *key) {
     pa_assert(p);
     pa_assert(key);
diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h
index c23ef23..4f1a1ec 100644
--- a/src/pulse/proplist.h
+++ b/src/pulse/proplist.h
@@ -213,7 +213,11 @@ const char *pa_proplist_iterate(pa_proplist *p, void **state);
  * 0.9.11 */
 char *pa_proplist_to_string(pa_proplist *p);
 
-/** Returns 1 if an entry for the specified key is existant in the
+/** Allocate a new property list and assign key/value from a human readable string. \since
+ * 0.9.14 */
+pa_proplist *pa_proplist_from_string(const char *str);
+
+  /** Returns 1 if an entry for the specified key is existant in the
  * property list. \since 0.9.11 */
 int pa_proplist_contains(pa_proplist *p, const char *key);
 
diff --git a/src/tests/proplist-test.c b/src/tests/proplist-test.c
index 20041af..f69fa68 100644
--- a/src/tests/proplist-test.c
+++ b/src/tests/proplist-test.c
@@ -29,8 +29,8 @@
 #include <pulsecore/core-util.h>
 
 int main(int argc, char*argv[]) {
-    pa_proplist *a, *b;
-    char *s, *t;
+    pa_proplist *a, *b, *c;
+    char *s, *t, *u;
 
     a = pa_proplist_new();
     pa_assert_se(pa_proplist_sets(a, PA_PROP_MEDIA_TITLE, "Brandenburgische Konzerte") == 0);
@@ -50,11 +50,18 @@ int main(int argc, char*argv[]) {
     s = pa_proplist_to_string(a);
     t = pa_proplist_to_string(b);
     printf("---\n%s---\n%s", s, t);
+
+    c = pa_proplist_from_string(s);
+    u = pa_proplist_to_string(c);
+    pa_assert_se(pa_streq(s, u));
+
     pa_xfree(s);
     pa_xfree(t);
+    pa_xfree(u);
 
     pa_proplist_free(a);
     pa_proplist_free(b);
+    pa_proplist_free(c);
 
     return 0;
 }

commit 9d6e9f51df19c161646448cf922d6b216ea5c3f6
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Fri Oct 31 18:43:38 2008 +0200

    cli: update-sink-proplist

diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index b5ff98d..3cb2a14 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -121,6 +121,7 @@ static int pa_cli_command_log_level(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
 static int pa_cli_command_log_meta(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 static int pa_cli_command_log_time(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 static int pa_cli_command_log_backtrace(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
+static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail);
 
 /* A method table for all available commands */
 
@@ -146,6 +147,7 @@ static const struct command commands[] = {
     { "set-sink-mute",           pa_cli_command_sink_mute,          "Set the mute switch of a sink (args: index|name, bool)", 3},
     { "set-sink-input-mute",     pa_cli_command_sink_input_mute,    "Set the mute switch of a sink input (args: index, bool)", 3},
     { "set-source-mute",         pa_cli_command_source_mute,        "Set the mute switch of a source (args: index|name, bool)", 3},
+    { "update-sink-proplist",    pa_cli_command_update_sink_proplist, "Update the properties of a sink (args: index|name, properties)", 3},
     { "set-default-sink",        pa_cli_command_sink_default,       "Set the default sink (args: index|name)", 2},
     { "set-default-source",      pa_cli_command_source_default,     "Set the default source (args: index|name)", 2},
     { "kill-client",             pa_cli_command_kill_client,        "Kill a client (args: index)", 2},
@@ -650,6 +652,38 @@ static int pa_cli_command_source_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *bu
     return 0;
 }
 
+static int pa_cli_command_update_sink_proplist(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
+    const char *n, *s;
+    pa_sink *sink;
+    pa_proplist *p;
+
+    pa_core_assert_ref(c);
+    pa_assert(t);
+    pa_assert(buf);
+    pa_assert(fail);
+
+    if (!(n = pa_tokenizer_get(t, 1))) {
+        pa_strbuf_puts(buf, "You need to specify a sink either by its name or its index.\n");
+        return -1;
+    }
+
+    if (!(s = pa_tokenizer_get(t, 2))) {
+        pa_strbuf_puts(buf, "You need to specify a \"key=value\" argument.\n");
+        return -1;
+    }
+
+    if (!(sink = pa_namereg_get(c, n, PA_NAMEREG_SINK, 1))) {
+        pa_strbuf_puts(buf, "No sink found by this name or index.\n");
+        return -1;
+    }
+
+    p = pa_proplist_from_string(s);
+
+    pa_sink_update_proplist(sink, PA_UPDATE_REPLACE, p);
+
+    return 0;
+}
+
 static int pa_cli_command_sink_input_mute(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
     const char *n, *v;
     pa_sink_input *si;
@@ -1513,7 +1547,7 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
         size_t l;
 
         if (ifstate && *ifstate == IFSTATE_FALSE)
-             return 0;
+            return 0;
 
         l = strcspn(cs, whitespace);
 

commit 3d631df8dd4017a17bfd196783bfe3d4898feb63
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Mon Nov 10 19:11:40 2008 +0200

    build: print more informations about preopen

diff --git a/configure.ac b/configure.ac
index bd40948..8586dcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1139,8 +1139,8 @@ AC_SUBST(modlibexecdir)
 AC_ARG_ENABLE(
         [force-preopen],
         AS_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
-        [FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
-AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
+        [FORCE_PREOPEN=$enableval], [FORCE_PREOPEN=no])
+AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "xyes"])
 
 AC_CONFIG_FILES([
 Makefile
@@ -1255,6 +1255,7 @@ echo "
     System Config Path:            ${PA_SYSTEM_CONFIG_PATH}
     Compiler:                      ${CC}
     CFLAGS:                        ${CFLAGS}
+
     Have X11:                      ${ENABLE_X11}
     Enable OSS:                    ${ENABLE_OSS}
     Enable Alsa:                   ${ENABLE_ALSA}
@@ -1271,9 +1272,12 @@ echo "
     Enable libsamplerate:          ${ENABLE_LIBSAMPLERATE}
     Enable PolicyKit:              ${ENABLE_POLKIT}
     Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
+
     System User:                   ${PA_SYSTEM_USER}
     System Group:                  ${PA_SYSTEM_GROUP}
     Realtime Group:                ${PA_REALTIME_GROUP}
     Access Group:                  ${PA_ACCESS_GROUP}
     Enable per-user EsounD socket: ${ENABLE_PER_USER_ESOUND_SOCKET}
+    Force preopen:                 ${FORCE_PREOPEN}
+    Preopened modules:             ${PREOPEN_MODS}
 "

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list