mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-22 01:40:33 -05:00
conf: add more error checks
Fail when something goes wrong when adding spa-libs instead of silently ignoring it.
This commit is contained in:
parent
64cc53cc38
commit
5cb7d4c019
1 changed files with 6 additions and 1 deletions
|
|
@ -551,6 +551,7 @@ static int parse_spa_libs(void *user_data, const char *location,
|
|||
struct pw_context *context = d->context;
|
||||
struct spa_json it[2];
|
||||
char key[512], value[512];
|
||||
int res;
|
||||
|
||||
spa_json_init(&it[0], str, len);
|
||||
if (spa_json_enter_object(&it[0], &it[1]) < 0) {
|
||||
|
|
@ -560,7 +561,11 @@ static int parse_spa_libs(void *user_data, const char *location,
|
|||
|
||||
while (spa_json_get_string(&it[1], key, sizeof(key)) > 0) {
|
||||
if (spa_json_get_string(&it[1], value, sizeof(value)) > 0) {
|
||||
pw_context_add_spa_lib(context, key, value);
|
||||
if ((res = pw_context_add_spa_lib(context, key, value)) < 0) {
|
||||
pw_log_error("error adding spa-libs for '%s' in '%.*s': %s",
|
||||
key, (int)len, str, spa_strerror(res));
|
||||
return res;
|
||||
}
|
||||
d->count++;
|
||||
} else {
|
||||
pw_log_warn("config file error: missing spa-libs library name for '%s'", key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue