mirror of
https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
synced 2025-02-17 05:44:09 +00:00
mixer-control: Rely on stream-id on device for cardless devices
Some devices don't have a card to match against, (e.g. network sinks), which would make 'match_stream_with_devices()' get confused and log warnings about missing card devices when trying to match streams with devices. Avoid this by marking a stream as 'in-possession' if there was already a device with the stream ID set to it. This fixes warning like (gnome-shell:3521215): Gvc-CRITICAL **: 10:57:07.155: gvc_mixer_card_get_index: assertion 'GVC_IS_MIXER_CARD (card)' failed
This commit is contained in:
parent
7a621180b4
commit
c5ab6037f4
@ -1250,28 +1250,36 @@ match_stream_with_devices (GvcMixerControl *control,
|
|||||||
"port-name", &device_port_name,
|
"port-name", &device_port_name,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
card_id = gvc_mixer_card_get_index (card);
|
if (card == NULL) {
|
||||||
|
if (device_stream_id == stream_id) {
|
||||||
|
g_debug ("Matched stream %u with card-less device '%s', with stream already setup",
|
||||||
|
stream_id, description);
|
||||||
|
in_possession = TRUE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
card_id = gvc_mixer_card_get_index (card);
|
||||||
|
|
||||||
g_debug ("Attempt to match_stream update_with_existing_outputs - Try description : '%s', origin : '%s', device port name : '%s', card : %p, AGAINST stream port: '%s', sink card id %i",
|
g_debug ("Attempt to match_stream update_with_existing_outputs - Try description : '%s', origin : '%s', device port name : '%s', card : %p, AGAINST stream port: '%s', sink card id %i",
|
||||||
description,
|
|
||||||
origin,
|
|
||||||
device_port_name,
|
|
||||||
card,
|
|
||||||
stream_port->port,
|
|
||||||
stream_card_id);
|
|
||||||
|
|
||||||
if (stream_card_id == card_id &&
|
|
||||||
g_strcmp0 (device_port_name, stream_port->port) == 0) {
|
|
||||||
g_debug ("Match device with stream: We have a match with description: '%s', origin: '%s', cached already with device id %u, so set stream id to %i",
|
|
||||||
description,
|
description,
|
||||||
origin,
|
origin,
|
||||||
gvc_mixer_ui_device_get_id (device),
|
device_port_name,
|
||||||
stream_id);
|
card,
|
||||||
|
stream_port->port,
|
||||||
|
stream_card_id);
|
||||||
|
|
||||||
g_object_set (G_OBJECT (device),
|
if (stream_card_id == card_id &&
|
||||||
"stream-id", (gint)stream_id,
|
g_strcmp0 (device_port_name, stream_port->port) == 0) {
|
||||||
NULL);
|
g_debug ("Match device with stream: We have a match with description: '%s', origin: '%s', cached already with device id %u, so set stream id to %i",
|
||||||
in_possession = TRUE;
|
description,
|
||||||
|
origin,
|
||||||
|
gvc_mixer_ui_device_get_id (device),
|
||||||
|
stream_id);
|
||||||
|
|
||||||
|
g_object_set (G_OBJECT (device),
|
||||||
|
"stream-id", (gint)stream_id,
|
||||||
|
NULL);
|
||||||
|
in_possession = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (device_port_name);
|
g_free (device_port_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user