Skip to content

Commit

Permalink
windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grishka committed Aug 28, 2018
1 parent bfa1e6a commit 31fe4af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
20 changes: 18 additions & 2 deletions VoIPController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,14 @@ void VoIPController::Stop(){
{
LOGD("Before stop audio I/O");
MutexGuard m(audioIOMutex);
if(audioInput)
if(audioInput){
audioInput->Stop();
if(audioOutput)
audioInput->SetCallback(NULL, NULL);
}
if(audioOutput){
audioOutput->Stop();
audioOutput->SetCallback(NULL, NULL);
}
}
LOGD("Left VoIPController::Stop");
}
Expand Down Expand Up @@ -2375,7 +2379,13 @@ void VoIPController::SetConfig(const Config& cfg){
tgvoipLogFile=NULL;
}
if(!config.logFilePath.empty()){
#ifndef _WIN32
tgvoipLogFile=fopen(config.logFilePath.c_str(), "a");
#else
if(_wfopen_s(&tgvoipLogFile, config.logFilePath.c_str(), L"a")!=0){
tgvoipLogFile=NULL;
}
#endif
tgvoip_log_file_write_header(tgvoipLogFile);
}else{
tgvoipLogFile=NULL;
Expand All @@ -2385,7 +2395,13 @@ void VoIPController::SetConfig(const Config& cfg){
statsDump=NULL;
}
if(!config.statsDumpFilePath.empty()){
#ifndef _WIN32
statsDump=fopen(config.statsDumpFilePath.c_str(), "w");
#else
if(_wfopen_s(&statsDump, config.statsDumpFilePath.c_str(), L"w")!=0){
statsDump=NULL;
}
#endif
if(statsDump)
fprintf(statsDump, "Time\tRTT\tLRSeq\tLSSeq\tLASeq\tLostR\tLostS\tCWnd\tBitrate\tLoss%%\tJitter\tJDelay\tAJDelay\n");
else
Expand Down
5 changes: 5 additions & 0 deletions VoIPController.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,13 @@ namespace tgvoip{
double initTimeout;
double recvTimeout;
int dataSaving;
#ifndef _WIN32
std::string logFilePath="";
std::string statsDumpFilePath="";
#else
std::wstring logFilePath=L"";
std::wstring statsDumpFilePath=L"";
#endif

bool enableAEC;
bool enableNS;
Expand Down

0 comments on commit 31fe4af

Please sign in to comment.