media-session: count property changes correctly

This commit is contained in:
Wim Taymans 2020-11-30 15:05:53 +01:00
parent 95718792c4
commit f8e501169b

View file

@ -225,19 +225,21 @@ static int metadata_property(void *object, uint32_t subject,
const char *key, const char *type, const char *value) const char *key, const char *type, const char *value)
{ {
struct impl *impl = object; struct impl *impl = object;
bool changed = false; int changed = 0;
if (impl->sync) if (impl->sync)
return 0; return 0;
if (subject == PW_ID_CORE) { if (subject == PW_ID_CORE) {
if (key == NULL) if (key == NULL) {
pw_properties_clear(impl->props); pw_properties_clear(impl->props);
changed = 1;
}
else if (strstr(key, PREFIX) == key) { else if (strstr(key, PREFIX) == key) {
changed = pw_properties_set(impl->props, key, value); changed += pw_properties_set(impl->props, key, value);
} }
} }
if (changed) if (changed > 0)
add_idle_timeout(impl); add_idle_timeout(impl);
return 0; return 0;