[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] dbus: fix ActiveProfile setting
Arun Raghavan
gitlab at gitlab.freedesktop.org
Tue Aug 27 03:34:55 UTC 2019
Arun Raghavan pushed to branch master at PulseAudio / pulseaudio
Commits:
b76f6682 by David Emett at 2019-08-27T03:21:27Z
dbus: fix ActiveProfile setting
Just like with handle_set_active_port, we need to look up the profile
corresponding to the provided path rather than doing a name comparison.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/709
- - - - -
1 changed file:
- src/modules/dbus/iface-card.c
Changes:
=====================================
src/modules/dbus/iface-card.c
=====================================
@@ -324,7 +324,9 @@ static void handle_get_active_profile(DBusConnection *conn, DBusMessage *msg, vo
static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) {
pa_dbusiface_card *c = userdata;
const char *new_active_path;
- pa_dbusiface_card_profile *new_active;
+ pa_dbusiface_card_profile *profile;
+ void *state;
+ pa_dbusiface_card_profile *new_active = NULL;
int r;
pa_assert(conn);
@@ -334,7 +336,14 @@ static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DB
dbus_message_iter_get_basic(iter, &new_active_path);
- if (!(new_active = pa_hashmap_get(c->profiles, new_active_path))) {
+ PA_HASHMAP_FOREACH(profile, c->profiles, state) {
+ if (pa_streq(pa_dbusiface_card_profile_get_path(profile), new_active_path)) {
+ new_active = profile;
+ break;
+ }
+ }
+
+ if (!new_active) {
pa_dbus_send_error(conn, msg, PA_DBUS_ERROR_NOT_FOUND, "%s: No such profile.", new_active_path);
return;
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/b76f668253d24e5dd1b1bf865325e094ac6f05e9
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/b76f668253d24e5dd1b1bf865325e094ac6f05e9
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190827/9a991692/attachment-0001.html>
More information about the pulseaudio-commits
mailing list