mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-22 02:34:16 +00:00
pipewire: remove redundant code
The generic code can now also handle the single character debug specification.
This commit is contained in:
parent
9b3b6e2401
commit
5f30ccae50
|
@ -536,14 +536,6 @@ parse_pw_debug_env(void)
|
|||
*/
|
||||
pos += spa_scnprintf(pos, end - pos, "[ { conn.* = %d },", SPA_LOG_LEVEL_NONE);
|
||||
|
||||
/* We only have single-digit log levels, so any single-character
|
||||
* string is of the form PIPEWIRE_DEBUG=<N> */
|
||||
if (slen == 1) {
|
||||
if (parse_log_level(str, &lvl))
|
||||
pw_log_set_level(lvl);
|
||||
goto out;
|
||||
}
|
||||
|
||||
tokens = pw_split_strv(str, ",", INT_MAX, &n_tokens);
|
||||
if (n_tokens > 0) {
|
||||
int i;
|
||||
|
@ -560,14 +552,14 @@ parse_pw_debug_env(void)
|
|||
} else if (n_tok == 1 && parse_log_level(tok[0], &lvl)) {
|
||||
pw_log_set_level(lvl);
|
||||
} else {
|
||||
pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'\n", tokens[i]);
|
||||
pw_log_warn("Ignoring invalid format in PIPEWIRE_DEBUG: '%s'",
|
||||
tokens[i]);
|
||||
}
|
||||
|
||||
pw_free_strv(tok);
|
||||
}
|
||||
}
|
||||
pw_free_strv(tokens);
|
||||
out:
|
||||
pos += spa_scnprintf(pos, end - pos, "]");
|
||||
return strdup(json);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue