mirror of
https://github.com/jambonz/freeswitch-modules.git
synced 2025-12-18 22:27:43 +00:00
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:
@@ -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()));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user