2.1.1: a bunch of fixes

- Enabled delay-agnostic AEC on Windows & Linux, it seems to make a difference after all (telegramdesktop/tdesktop#4881)
- Fixed PulseAudio crashes, at least I hope so (closes #42)
- Fixed parsing of floating-point server config values in some locales in Linux
This commit is contained in:
Grishka
2018-07-02 00:42:49 +03:00
parent a541f8faf0
commit 697eea96aa
6 changed files with 55 additions and 61 deletions

View File

@@ -7,6 +7,8 @@
#include "VoIPServerConfig.h"
#include <stdlib.h>
#include "logging.h"
#include <sstream>
#include <locale>
using namespace tgvoip;
@@ -40,12 +42,12 @@ double ServerConfig::GetDouble(std::string name, double fallback){
MutexGuard sync(mutex);
if(ContainsKey(name)){
std::string val=config[name];
char* end;
const char* start=val.c_str();
double d=strtod(start, &end);
if(end!=start){
return d;
}
std::istringstream stm(val);
double rval=fallback;
stm.imbue(std::locale("C"));
stm >> rval;
if(!stm.fail())
return rval;
}
return fallback;
}