mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
filter-graph: accept String param values
We parse the string as a float and if that works, set the value.
This commit is contained in:
parent
16ce5a2ccf
commit
4da25df986
1 changed files with 4 additions and 1 deletions
|
|
@ -613,7 +613,7 @@ static int parse_params(struct graph *graph, const struct spa_pod *pod)
|
|||
return 0;
|
||||
|
||||
while (true) {
|
||||
const char *name;
|
||||
const char *name, *str_val;
|
||||
float value, *val = NULL;
|
||||
double dbl_val;
|
||||
bool bool_val;
|
||||
|
|
@ -636,6 +636,9 @@ static int parse_params(struct graph *graph, const struct spa_pod *pod)
|
|||
} else if (spa_pod_parser_get_bool(&prs, &bool_val) >= 0) {
|
||||
value = bool_val ? 1.0f : 0.0f;
|
||||
val = &value;
|
||||
} else if (spa_pod_parser_get_string(&prs, &str_val) >= 0 &&
|
||||
spa_json_parse_float(str_val, strlen(str_val), &value) >= 0) {
|
||||
val = &value;
|
||||
} else {
|
||||
struct spa_pod *pod;
|
||||
spa_pod_parser_get_pod(&prs, &pod);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue