feat/106: converting playht speed option to float instead of integer (#107)

* feat/106: converting playht speed option to float instead of integer

* feat/106: Using strtod

* feat/106: Using strtod

Signed-off-by: Rammohan Yadavalli <rammohan.yadavalli@kore.com>

---------

Signed-off-by: Rammohan Yadavalli <rammohan.yadavalli@kore.com>
Signed-off-by: Rammohan Yadavalli <rammohan.yadavalli@gmail.com>
Co-authored-by: Rammohan Yadavalli <rammohan.yadavalli@kore.com>
This commit is contained in:
rammohan-y
2024-08-23 20:19:55 +05:30
committed by GitHub
parent eec4df4b77
commit d01991ed0f
2 changed files with 8 additions and 2 deletions

View File

@@ -774,7 +774,10 @@ extern "C" {
cJSON_AddStringToObject(jResult, "quality", p->quality);
}
if (p->speed) {
cJSON_AddNumberToObject(jResult, "speed", atoi(p->speed));
double val = strtod(p->speed, NULL);
if (val != 0.0) {
cJSON_AddNumberToObject(jResult, "speed", val);
}
}
if (p->seed) {
cJSON_AddNumberToObject(jResult, "seed", atoi(p->seed));