[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-45-g0815455

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Mar 23 11:31:40 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  906fd570c71677dca9f1c12366b009d9a0b95e1a (commit)

- Log -----------------------------------------------------------------
0815455 only store card profile if flagged for that
124de50 enable bluetooth default by support
-----------------------------------------------------------------------

Summary of changes:
 src/daemon/default.pa.in          |    2 +-
 src/modules/module-card-restore.c |    3 +++
 src/pulsecore/card.c              |   10 +++++++---
 src/pulsecore/card.h              |    6 +++++-
 src/pulsecore/cli-command.c       |    2 +-
 src/pulsecore/protocol-native.c   |    2 +-
 6 files changed, 18 insertions(+), 7 deletions(-)

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

commit 124de50ef8e4074302c0c205e61ccd78744dd549
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 23 19:16:00 2009 +0100

    enable bluetooth default by support

diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
index 02ac8e5..57ccd9f 100755
--- a/src/daemon/default.pa.in
+++ b/src/daemon/default.pa.in
@@ -59,7 +59,7 @@ load-module module-detect
 
 ### Automatically load driver modules for Bluetooth hardware
 #.ifexists module-bluetooth-discover at PA_SOEXT@
-#load-module module-bluetooth-discover
+load-module module-bluetooth-discover
 #.endif
 
 ### Load several protocols

commit 08154554b0cdce6d16816536211718bf14ff33ff
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 23 19:31:36 2009 +0100

    only store card profile if flagged for that

diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c
index 0afb935..17f1f8c 100644
--- a/src/modules/module-card-restore.c
+++ b/src/modules/module-card-restore.c
@@ -161,6 +161,9 @@ static void subscribe_callback(pa_core *c, pa_subscription_event_type_t t, uint3
     if (!(card = pa_idxset_get_by_index(c->cards, idx)))
         return;
 
+    if (!card->save_profile)
+        return;
+
     pa_strlcpy(entry.profile, card->active_profile ? card->active_profile->name : "", sizeof(entry.profile));
 
     if ((old = read_entry(u, card->name))) {
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c
index 6419c23..f268f7c 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/card.c
@@ -143,7 +143,8 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
     c->active_profile = NULL;
 
     if (data->active_profile && c->profiles)
-        c->active_profile = pa_hashmap_get(c->profiles, data->active_profile);
+        if ((c->active_profile = pa_hashmap_get(c->profiles, data->active_profile)))
+            c->save_profile = data->save_profile;
 
     if (!c->active_profile && c->profiles) {
         void *state = NULL;
@@ -209,7 +210,7 @@ void pa_card_free(pa_card *c) {
     pa_xfree(c);
 }
 
-int pa_card_set_profile(pa_card *c, const char *name) {
+int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save) {
     pa_card_profile *profile;
     pa_assert(c);
 
@@ -224,8 +225,10 @@ int pa_card_set_profile(pa_card *c, const char *name) {
     if (!(profile = pa_hashmap_get(c->profiles, name)))
         return -1;
 
-    if (c->active_profile == profile)
+    if (c->active_profile == profile) {
+        c->save_profile = c->save_profile || save;
         return 0;
+    }
 
     if (c->set_profile(c, profile) < 0)
         return -1;
@@ -235,6 +238,7 @@ int pa_card_set_profile(pa_card *c, const char *name) {
     pa_log_info("Changed profile of card %u \"%s\" to %s", c->index, c->name, profile->name);
 
     c->active_profile = profile;
+    c->save_profile = save;
 
     return 0;
 }
diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
index c80d4e2..3b7608f 100644
--- a/src/pulsecore/card.h
+++ b/src/pulsecore/card.h
@@ -63,6 +63,8 @@ struct pa_card {
     pa_hashmap *profiles;
     pa_card_profile *active_profile;
 
+    pa_bool_t save_profile;
+
     void *userdata;
 
     int (*set_profile)(pa_card *c, pa_card_profile *profile);
@@ -80,6 +82,8 @@ typedef struct pa_card_new_data {
     char *active_profile;
 
     pa_bool_t namereg_fail:1;
+
+    pa_bool_t save_profile:1;
 } pa_card_new_data;
 
 pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
@@ -93,7 +97,7 @@ void pa_card_new_data_done(pa_card_new_data *data);
 pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
 void pa_card_free(pa_card *c);
 
-int pa_card_set_profile(pa_card *c, const char *name);
+int pa_card_set_profile(pa_card *c, const char *name, pa_bool_t save);
 
 int pa_card_suspend(pa_card *c, pa_bool_t suspend);
 
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index b5f7e7f..d4d407c 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -1454,7 +1454,7 @@ static int pa_cli_command_card_profile(pa_core *c, pa_tokenizer *t, pa_strbuf *b
         return -1;
     }
 
-    if (pa_card_set_profile(card, p) < 0) {
+    if (pa_card_set_profile(card, p, TRUE) < 0) {
         pa_strbuf_printf(buf, "Failed to set card profile to '%s'.\n", p);
         return -1;
     }
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 4860860..ff49e69 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -4119,7 +4119,7 @@ static void command_set_card_profile(pa_pdispatch *pd, uint32_t command, uint32_
 
     CHECK_VALIDITY(c->pstream, card, tag, PA_ERR_NOENTITY);
 
-    if (pa_card_set_profile(card, profile) < 0) {
+    if (pa_card_set_profile(card, profile, TRUE) < 0) {
         pa_pstream_send_error(c->pstream, tag, PA_ERR_INVALID);
         return;
     }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list