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-yandRammohan Yadavalli authored and GitHub committed 2024-08-23 10:49:55 -04:00
1 parent eec4df4b77
commit d01991ed0f
2 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -378,7 +378,10 @@ switch_status_t playht_parse_text(const std::map<std::string, std::string>& para
cJSON_AddStringToObject(jResult, "quality", quality.c_str());
}
if (!speed.empty()) {
cJSON_AddNumberToObject(jResult, "speed", atoi(speed.c_str()));
double val = strtod(speed.c_str(), NULL);
if (val != 0.0) {
cJSON_AddNumberToObject(jResult, "speed", val);
}
}
if (!seed.empty()) {
cJSON_AddNumberToObject(jResult, "seed", atoi(seed.c_str()));