mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
tools: try to parse float values better
First try to parse the float value as a JSON number and then fall back to atof to get the locale dependent variant. This transparently makes things work with values such as 0.5 and 0,5. Fixes #4234
This commit is contained in:
parent
a77a6f3959
commit
0956fc0884
2 changed files with 4 additions and 2 deletions
|
|
@ -163,7 +163,8 @@ int main(int argc, char *argv[])
|
|||
data.latency = atoi(optarg) * DEFAULT_RATE / SPA_MSEC_PER_SEC;
|
||||
break;
|
||||
case 'd':
|
||||
data.delay = (float)atof(optarg);
|
||||
if (!spa_atof(optarg, &data.delay))
|
||||
data.delay = (float)atof(optarg);
|
||||
break;
|
||||
case 'C':
|
||||
pw_properties_set(data.capture_props, PW_KEY_TARGET_OBJECT, optarg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue