[pulseaudio-commits] Branch 'next' - 4 commits - src/modules src/pulsecore
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Mon Apr 29 08:46:12 PDT 2013
src/modules/bluetooth/module-bluetooth-device.c | 4 ++--
src/pulsecore/module.c | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit 8f2a37f9c12310c787a57f27eeb7ad3b859b84cb
Author: Tanu Kaskinen <tanu.kaskinen at intel.com>
Date: Mon Apr 29 16:46:13 2013 +0300
module: Assign the index before calling init()
Any code that runs inside the init() callback sees an invalid module
index. Sometimes init() does things that cause hooks to be fired. This
means that any code that uses hooks may see an invalid module index.
Fix this by assigning the module index before init() is called.
There are no known issues in the upstream code base where an invalid
module index would be used, but an out-of-tree module
(module-murphy-ivi) had a problem with this.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=63923
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index 6f276bb..f30a3ce 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -113,14 +113,14 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
m->core = c;
m->unload_requested = FALSE;
+ pa_assert_se(pa_idxset_put(c->modules, m, &m->index) >= 0);
+ pa_assert(m->index != PA_IDXSET_INVALID);
+
if (m->init(m) < 0) {
pa_log_error("Failed to load module \"%s\" (argument: \"%s\"): initialization failed.", name, argument ? argument : "");
goto fail;
}
- pa_assert_se(pa_idxset_put(c->modules, m, &m->index) >= 0);
- pa_assert(m->index != PA_IDXSET_INVALID);
-
pa_log_info("Loaded \"%s\" (index: #%u; argument: \"%s\").", m->name, m->index, m->argument ? m->argument : "");
pa_subscription_post(c, PA_SUBSCRIPTION_EVENT_MODULE|PA_SUBSCRIPTION_EVENT_NEW, m->index);
@@ -144,6 +144,9 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
fail:
if (m) {
+ if (m->index != PA_IDXSET_INVALID)
+ pa_idxset_remove_by_index(c->modules, m->index);
+
if (m->proplist)
pa_proplist_free(m->proplist);
commit 99cd77fa935d04e8cc4dbd548b2722e5b0471e8e
Author: João Paulo Rechi Vita <jprvita at openbossa.org>
Date: Fri Apr 26 21:24:52 2013 -0300
bluetooth: Remove the 'bluez.name' property
The 'Name' property of the Device interface became optional in BlueZ 5
and may not be present anymore (that happens when testing against the
PTS 4.7.0), so it's better not to expose it to clients so they don't
rely on its existence.
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 6f377ab..4146c0d 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2250,7 +2250,6 @@ static int add_card(struct userdata *u) {
pa_proplist_sets(data.proplist, "bluez.path", device->path);
pa_proplist_setf(data.proplist, "bluez.class", "0x%06x", (unsigned) device->class);
- pa_proplist_sets(data.proplist, "bluez.name", device->name);
pa_proplist_sets(data.proplist, "bluez.alias", device->alias);
data.name = get_name("card", u->modargs, device->address, &b);
data.namereg_fail = b;
commit a3913b05790f4782a22f9e62498b9184bf4dd25e
Author: João Paulo Rechi Vita <jprvita at openbossa.org>
Date: Fri Apr 26 21:26:36 2013 -0300
bluetooth: Use 'Alias' value as the device description
The 'Alias' property should be preffered over the 'Name' property,
according to the BlueZ API documentation.
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 9bc109b..6f377ab 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2237,7 +2237,7 @@ static int add_card(struct userdata *u) {
data.driver = __FILE__;
data.module = u->module;
- n = pa_bluetooth_cleanup_name(device->name);
+ n = pa_bluetooth_cleanup_name(device->alias);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, n);
pa_xfree(n);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, device->address);
commit c9a46b9c5fdff86bace046ecc9ef90449e5cf694
Author: João Paulo Rechi Vita <jprvita at openbossa.org>
Date: Fri Apr 26 12:30:24 2013 -0300
bluetooth: Add 'bluez.alias' property
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index cd0a515..9bc109b 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2251,6 +2251,7 @@ static int add_card(struct userdata *u) {
pa_proplist_sets(data.proplist, "bluez.path", device->path);
pa_proplist_setf(data.proplist, "bluez.class", "0x%06x", (unsigned) device->class);
pa_proplist_sets(data.proplist, "bluez.name", device->name);
+ pa_proplist_sets(data.proplist, "bluez.alias", device->alias);
data.name = get_name("card", u->modargs, device->address, &b);
data.namereg_fail = b;
More information about the pulseaudio-commits
mailing list