metadata: emit removed messages from clear

Consume the array until we have removed all subjects.
This commit is contained in:
Wim Taymans 2020-05-06 15:47:14 +02:00
parent 9174e5ca20
commit 720b7b5c6a

View file

@ -146,9 +146,13 @@ static void clear_items(struct metadata *this)
{ {
struct item *item; struct item *item;
pw_array_for_each(item, &this->metadata) while (true) {
clear_item(item); item = pw_array_first(&this->metadata);
if (!pw_array_check(&this->metadata, item))
break;
clear_subjects(this, item->subject);
}
pw_array_reset(&this->metadata); pw_array_reset(&this->metadata);
} }
@ -161,6 +165,8 @@ static int impl_set_property(void *object,
struct metadata *this = object; struct metadata *this = object;
struct item *item = NULL; struct item *item = NULL;
pw_log_debug(NAME" %p: id:%d key:%s type:%s value:%s", this, subject, key, type, value);
if (key == NULL) if (key == NULL)
return clear_subjects(this, subject); return clear_subjects(this, subject);