mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -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, },
|
{ NULL, },
|
||||||
};
|
};
|
||||||
d->state = STATE_FIRST;
|
d->state = STATE_FIRST;
|
||||||
put_begin(d, NULL, "[", 0);
|
|
||||||
spa_list_for_each(o, &d->object_list, link) {
|
spa_list_for_each(o, &d->object_list, link) {
|
||||||
if (d->id != SPA_ID_INVALID && d->id != o->id)
|
if (d->id != SPA_ID_INVALID && d->id != o->id)
|
||||||
continue;
|
continue;
|
||||||
if (o->changed == 0)
|
if (o->changed == 0)
|
||||||
continue;
|
continue;
|
||||||
|
if (d->state == STATE_FIRST)
|
||||||
|
put_begin(d, NULL, "[", 0);
|
||||||
put_begin(d, NULL, "{", 0);
|
put_begin(d, NULL, "{", 0);
|
||||||
put_int(d, "id", o->id);
|
put_int(d, "id", o->id);
|
||||||
put_value(d, "type", o->type);
|
put_value(d, "type", o->type);
|
||||||
|
|
@ -1283,7 +1284,8 @@ static void dump_objects(struct data *d)
|
||||||
put_end(d, "}", 0);
|
put_end(d, "}", 0);
|
||||||
o->changed = 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)
|
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