mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioconvert: use spa_dtoa to format floats and doubles
The parsing functions expect float values in the default locale so use the spa_dtoa function to generate such a float. Fixes setting params with floating point values when the locale is not the default locale.
This commit is contained in:
parent
59e49d31eb
commit
0adc351d36
1 changed files with 4 additions and 1 deletions
|
|
@ -825,8 +825,11 @@ static int parse_prop_params(struct impl *this, struct spa_pod *params)
|
|||
if (spa_pod_is_string(pod)) {
|
||||
spa_pod_copy_string(pod, sizeof(value), value);
|
||||
} else if (spa_pod_is_float(pod)) {
|
||||
snprintf(value, sizeof(value), "%f",
|
||||
spa_dtoa(value, sizeof(value),
|
||||
SPA_POD_VALUE(struct spa_pod_float, pod));
|
||||
} else if (spa_pod_is_double(pod)) {
|
||||
spa_dtoa(value, sizeof(value),
|
||||
SPA_POD_VALUE(struct spa_pod_double, pod));
|
||||
} else if (spa_pod_is_int(pod)) {
|
||||
snprintf(value, sizeof(value), "%d",
|
||||
SPA_POD_VALUE(struct spa_pod_int, pod));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue