mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
jack: fix default source and sink handling
This commit is contained in:
parent
8c893cbc4a
commit
759e1ccb6b
1 changed files with 28 additions and 18 deletions
|
|
@ -2003,6 +2003,19 @@ static int metadata_property(void *object, uint32_t id,
|
||||||
|
|
||||||
pw_log_info("set id:%u key:'%s' value:'%s' type:'%s'", id, key, value, type);
|
pw_log_info("set id:%u key:'%s' value:'%s' type:'%s'", id, key, value, type);
|
||||||
|
|
||||||
|
if (id == PW_ID_CORE) {
|
||||||
|
if (key) {
|
||||||
|
uint32_t val = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
||||||
|
if (strcmp(key, "default.audio.sink") == 0) {
|
||||||
|
c->metadata->default_audio_sink = val;
|
||||||
|
} else if (strcmp(key, "default.audio.source") == 0) {
|
||||||
|
c->metadata->default_audio_source = val;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
c->metadata->default_audio_source = SPA_ID_INVALID;
|
||||||
|
c->metadata->default_audio_sink = SPA_ID_INVALID;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
o = pw_map_lookup(&c->context.globals, id);
|
o = pw_map_lookup(&c->context.globals, id);
|
||||||
if (o == NULL)
|
if (o == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -2018,12 +2031,8 @@ static int metadata_property(void *object, uint32_t id,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
update_property(c, uuid, key, type, value);
|
update_property(c, uuid, key, type, value);
|
||||||
|
|
||||||
if (key && strcmp(key, "default.audio.sink") == 0) {
|
|
||||||
c->metadata->default_audio_sink = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
|
||||||
} else if (key && strcmp(key, "default.audio.source") == 0) {
|
|
||||||
c->metadata->default_audio_source = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4072,6 +4081,7 @@ static int port_compare_func(const void *v1, const void *v2)
|
||||||
is_cap1 = ((*o1)->port.flags & JackPortIsOutput) == JackPortIsOutput;
|
is_cap1 = ((*o1)->port.flags & JackPortIsOutput) == JackPortIsOutput;
|
||||||
is_cap2 = ((*o2)->port.flags & JackPortIsOutput) == JackPortIsOutput;
|
is_cap2 = ((*o2)->port.flags & JackPortIsOutput) == JackPortIsOutput;
|
||||||
|
|
||||||
|
|
||||||
if (c->metadata) {
|
if (c->metadata) {
|
||||||
if (is_cap1)
|
if (is_cap1)
|
||||||
is_def1 = (*o1)->port.node_id == c->metadata->default_audio_source;
|
is_def1 = (*o1)->port.node_id == c->metadata->default_audio_source;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue