mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pw-dump: only output [] when something changed
This commit is contained in:
parent
a97d4c44b4
commit
688b3c5ed4
1 changed files with 4 additions and 2 deletions
|
|
@ -1265,12 +1265,13 @@ static void dump_objects(struct data *d)
|
|||
{ NULL, },
|
||||
};
|
||||
d->state = STATE_FIRST;
|
||||
put_begin(d, NULL, "[", 0);
|
||||
spa_list_for_each(o, &d->object_list, link) {
|
||||
if (d->id != SPA_ID_INVALID && d->id != o->id)
|
||||
continue;
|
||||
if (o->changed == 0)
|
||||
continue;
|
||||
if (d->state == STATE_FIRST)
|
||||
put_begin(d, NULL, "[", 0);
|
||||
put_begin(d, NULL, "{", 0);
|
||||
put_int(d, "id", o->id);
|
||||
put_value(d, "type", o->type);
|
||||
|
|
@ -1283,7 +1284,8 @@ static void dump_objects(struct data *d)
|
|||
put_end(d, "}", 0);
|
||||
o->changed = 0;
|
||||
}
|
||||
put_end(d, "]\n", 0);
|
||||
if (d->state != STATE_FIRST)
|
||||
put_end(d, "]\n", 0);
|
||||
}
|
||||
|
||||
static void on_core_error(void *data, uint32_t id, int seq, int res, const char *message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue