mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05: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
|
|
@ -649,14 +649,13 @@ static int metadata_property(void *object,
|
|||
uint32_t subject, const char *key, const char *type, const char *value)
|
||||
{
|
||||
struct data *data = object;
|
||||
uint32_t val;
|
||||
|
||||
if (key && strcmp(key, "default.audio.sink") == 0) {
|
||||
val = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
||||
data->default_sink = val;
|
||||
} else if (key && strcmp(key, "default.audio.source") == 0) {
|
||||
val = value ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
||||
data->default_source = val;
|
||||
if (subject == PW_ID_CORE) {
|
||||
uint32_t val = (key && value) ? (uint32_t)atoi(value) : SPA_ID_INVALID;
|
||||
if (key == NULL || strcmp(key, "default.audio.sink") == 0)
|
||||
data->default_sink = val;
|
||||
if (key == NULL || strcmp(key, "default.audio.source") == 0)
|
||||
data->default_source = val;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue