mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
metadata: improve default sink/source
Only check defaults when subject is PW_ID_CORE Handle NULL keys: remove the defaults
This commit is contained in:
parent
759e1ccb6b
commit
0c04481ba7
6 changed files with 53 additions and 57 deletions
|
|
@ -969,11 +969,12 @@ static int metadata_property(void *object,
|
|||
struct global *g = object;
|
||||
snd_ctl_pipewire_t *ctl = g->ctl;
|
||||
|
||||
if (key) {
|
||||
if (strcmp(key, "default.audio.sink") == 0)
|
||||
ctl->sink = value ? (uint32_t)atoi(value) : 0;
|
||||
if (strcmp(key, "default.audio.source") == 0)
|
||||
ctl->source = value ? (uint32_t)atoi(value) : 0;
|
||||
if (subject == PW_ID_CORE) {
|
||||
uint32_t val = (key && value) ? (uint32_t)atoi(value) : 0;
|
||||
if (key == NULL || strcmp(key, "default.audio.sink") == 0)
|
||||
ctl->sink = val;
|
||||
if (key == NULL || strcmp(key, "default.audio.source") == 0)
|
||||
ctl->source = val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue