Permalink
Browse files

Fixed code review findings

  • Loading branch information...
1 parent 2115b6d commit 04ca6d30bc3a7bef023eaca71d40fdb73e22a4eb @tourettes tourettes committed Jul 19, 2013
@@ -24,6 +24,7 @@
#include "alloctracing.h"
extern void Log(const char *fmt, ...);
+extern void StartLogger();
extern void LogRotate();
unsigned int gAllowedAC3bitrates[9] = {192, 224, 256, 320, 384, 448, 512, 576, 640};
@@ -131,6 +132,7 @@ AudioRendererSettings::AudioRendererSettings() :
m_bReleaseDeviceOnStop(false),
m_bExpandMonoToStereo(true)
{
+ StartLogger();
LogRotate();
Log("MP Audio Renderer - v1.1.6");
@@ -128,7 +128,6 @@ CCritSec m_qLock;
CCritSec m_threadLock;
std::queue<std::string> m_logQueue;
-BOOL m_bLoggerRunning;
HANDLE m_hLogger = NULL;
CAMEvent m_eLog;
CAMEvent m_eStop;
@@ -165,8 +164,6 @@ UINT CALLBACK LogThread(void* param)
FILE* pFile = _tfopen(fileName, _T("a+"));
if (pFile)
{
- SYSTEMTIME systemTime;
- GetLocalTime(&systemTime);
string line = GetLogLine();
while (!line.empty())
{
@@ -209,7 +206,6 @@ void StopLogger()
{
m_eStop.Set();
WaitForSingleObject(m_hLogger, INFINITE);
- m_bLoggerRunning = FALSE;
m_hLogger = NULL;
}
}
@@ -222,11 +218,7 @@ void Log(const char *fmt, ...)
CAutoLock logLock(&lock);
if (!m_hLogger)
- {
- CAutoLock lock(&m_qLock);
- m_bLoggerRunning = true;
- StartLogger();
- }
+ return;
char buffer[MAX_LOG_LINE_LENGHT - LOG_LINE_RESERVED];
int ret;

0 comments on commit 04ca6d3

Please sign in to comment.