mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-15 22:20:09 +00:00
media-session: improve property save/load
Allow spaces in the property values.
This commit is contained in:
parent
dadb3a884d
commit
05416b497c
|
@ -1798,9 +1798,16 @@ int sm_media_session_load_state(struct sm_media_session *sess,
|
|||
}
|
||||
f = fdopen(fd, "r");
|
||||
while (fgets(line, sizeof(line)-1, f)) {
|
||||
char k[1024], v[1024];
|
||||
if (sscanf(line, "%s %s", k, v) == 2)
|
||||
count += pw_properties_set(props, k, v);
|
||||
char *val, *k;
|
||||
val = strrchr(line, '\n');
|
||||
if (val)
|
||||
*val = '\0';
|
||||
val = strchr(line, ' ');
|
||||
if (val == NULL)
|
||||
continue;
|
||||
k = val + 1;
|
||||
*val = '\0';
|
||||
count += pw_properties_set(props, line, k);
|
||||
}
|
||||
fclose(f);
|
||||
return count;
|
||||
|
|
Loading…
Reference in a new issue