mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-03-21 18:10:41 +01:00
wpctl: Allow virtual nodes in set-default command
Use prefix matching instead of exact matching for media.class when validating nodes in the set-default command. This allows virtual nodes (e.g. Audio/Source/Virtual) to be set as default devices, while still excluding internal nodes. Fixes #896 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
80842cbb96
commit
024f88322c
1 changed files with 2 additions and 1 deletions
|
|
@ -870,7 +870,8 @@ set_default_run (WpCtl * self)
|
|||
media_class = wp_pipewire_object_get_property (WP_PIPEWIRE_OBJECT (proxy),
|
||||
PW_KEY_MEDIA_CLASS);
|
||||
for (guint i = 0; i < G_N_ELEMENTS (DEFAULT_NODE_MEDIA_CLASSES); i++) {
|
||||
if (!g_strcmp0 (media_class, DEFAULT_NODE_MEDIA_CLASSES[i])) {
|
||||
if (g_str_has_prefix (media_class, DEFAULT_NODE_MEDIA_CLASSES[i]) &&
|
||||
!g_str_has_suffix (media_class, "/Internal")) {
|
||||
gboolean res = FALSE;
|
||||
const gchar *name = wp_pipewire_object_get_property (
|
||||
WP_PIPEWIRE_OBJECT (proxy), PW_KEY_NODE_NAME);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue