pw-dump: don't emit remove events when not monitoring

When pw-dump is called without --monitor, it should output exactly one
JSON array, and no remove event indicators.
This commit is contained in:
Pauli Virtanen 2024-11-23 13:03:29 +02:00 committed by Wim Taymans
parent 603c67628e
commit c36c028dd2

View file

@ -1392,7 +1392,7 @@ static void registry_event_global_remove(void *data, uint32_t id)
if ((o = find_object(d, id)) == NULL) if ((o = find_object(d, id)) == NULL)
return; return;
if (!d->pattern || object_matches(o, d->pattern)) { if (d->monitor && (!d->pattern || object_matches(o, d->pattern))) {
d->state = STATE_FIRST; d->state = STATE_FIRST;
if (d->state == STATE_FIRST) if (d->state == STATE_FIRST)
put_begin(d, NULL, "[", 0); put_begin(d, NULL, "[", 0);