mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-09 06:19:23 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user