mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
spa: add spa_json_begin
That combines spa_json_init() and spa_json_next, a common thing to do.
This commit is contained in:
parent
08057e0328
commit
feccb882b6
7 changed files with 15 additions and 18 deletions
|
|
@ -123,8 +123,7 @@ static int process_json(const char *filename, void *buf, size_t size)
|
|||
struct spa_json it;
|
||||
const char *value;
|
||||
|
||||
spa_json_init(&it, buf, size);
|
||||
if ((len = spa_json_next(&it, &value)) <= 0) {
|
||||
if ((len = spa_json_begin(&it, buf, size, &value)) <= 0) {
|
||||
fprintf(stderr, "not a valid file '%s': %s\n", filename, spa_strerror(len));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue