mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -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
e2a76824e2
commit
16a7467815
2 changed files with 4 additions and 2 deletions
|
|
@ -1778,6 +1778,7 @@ int main(int argc, char *argv[])
|
|||
break;
|
||||
|
||||
case OPT_VOLUME:
|
||||
if (!spa_atof(optarg, &data.volume))
|
||||
data.volume = (float)atof(optarg);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ int main(int argc, char *argv[])
|
|||
data.latency = atoi(optarg) * DEFAULT_RATE / SPA_MSEC_PER_SEC;
|
||||
break;
|
||||
case 'd':
|
||||
if (!spa_atof(optarg, &data.delay))
|
||||
data.delay = (float)atof(optarg);
|
||||
break;
|
||||
case 'C':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue