m-device-activation: always activate alsa devices if no api alsa card property was set

This commit is contained in:
Julian Bouzas 2020-06-11 15:20:24 -04:00
parent be3045e1f8
commit 05aeeed90c

View file

@ -151,10 +151,10 @@ on_device_added (WpObjectManager *om, WpProxy *proxy, gpointer d)
/* ALSA */
if (g_str_has_prefix (device_api, "alsa")) {
/* If "dbus" mode, let dbus handle the activation, otherwise activate */
if (self->mode && g_strcmp0 (self->mode, "dbus") == 0) {
const gchar *id = wp_proxy_get_property (proxy, SPA_KEY_API_ALSA_CARD);
g_return_if_fail (id);
const gchar *id = wp_proxy_get_property (proxy, SPA_KEY_API_ALSA_CARD);
/* If "dbus" mode and Id is valid, let dbus handle the activation,
* otherwise always activate the device */
if (self->mode && g_strcmp0 (self->mode, "dbus") == 0 && id) {
add_reserve_device_data (self, proxy, atoi (id));
} else {
set_device_profile (proxy, 1);