media-session: check metadata before using it

The session manager might be configured without metadata support
so check this before attempting to use the metadata. It's not
really a problem because the default sink/source can only be
changed with the pulseaudio API, which activates metadata.
This commit is contained in:
Wim Taymans 2021-03-05 10:34:27 +01:00
parent 93002ecd11
commit b40397d986
2 changed files with 14 additions and 8 deletions

View file

@ -217,7 +217,8 @@ static void sync_metadata(struct impl *impl)
impl->sync = true;
spa_dict_for_each(it, &impl->props->dict)
pw_metadata_set_property(impl->metadata, 0, it->key, "Spa:String:JSON", it->value);
pw_metadata_set_property(impl->metadata,
PW_ID_CORE, it->key, "Spa:String:JSON", it->value);
impl->sync = false;
}