- cleanup

This commit is contained in:
Dmytro Bogovych 2020-10-29 10:09:58 +02:00
parent 5450c155d9
commit 6554688cb7
8 changed files with 24 additions and 11 deletions

View File

@ -38,7 +38,7 @@ class AudioManager: public Audio::Player::EndOfAudioDelegate
{ {
public: public:
AudioManager(); AudioManager();
~AudioManager(); virtual ~AudioManager();
static AudioManager& instance(); static AudioManager& instance();

View File

@ -98,6 +98,10 @@ unsigned TimeSource::time()
#if defined(TARGET_LINUX) #if defined(TARGET_LINUX)
assert(0); assert(0);
#endif #endif
#if defined(TARGET_ANDROID)
assert(0);
#endif
} }
// --- StubTimer --- // --- StubTimer ---

View File

@ -237,8 +237,8 @@ std::pair<std::string, std::string> StringHelper::parseAssignment(const std::str
result.second = StringHelper::trim(s.substr(p+1)); result.second = StringHelper::trim(s.substr(p+1));
if (trimQuotes && result.second.size() >= 2) if (trimQuotes && result.second.size() >= 2)
{ {
if (result.second[0] == '"' && result.second[result.second.size()-1] == '"' || if ((result.second[0] == '"' && result.second[result.second.size()-1] == '"') ||
result.second[0] == '\'' && result.second[result.second.size()-1] == '\'') (result.second[0] == '\'' && result.second[result.second.size()-1] == '\''))
result.second = result.second.substr(1, result.second.size() - 2); result.second = result.second.substr(1, result.second.size() - 2);
} }
} }

View File

@ -41,6 +41,8 @@ long SyncHelper::increment(long *value)
return OSAtomicIncrement32((int32_t*)value); return OSAtomicIncrement32((int32_t*)value);
#elif TARGET_LINUX #elif TARGET_LINUX
return -1; return -1;
#else
return -1;
#endif #endif
} }
@ -66,6 +68,11 @@ uint64_t ThreadHelper::getCurrentId()
// RPi builds want this! // RPi builds want this!
return (uint64_t)(pthread_self()); return (uint64_t)(pthread_self());
#endif #endif
#if defined(TARGET_ANDROID)
return (uint64_t)(pthread_self());
#endif
return 0;
} }
// ------------------- TimeHelper --------------- // ------------------- TimeHelper ---------------
using namespace std::chrono; using namespace std::chrono;

View File

@ -71,4 +71,6 @@ bool Uuid::operator < (const Uuid& right) const
#if defined(TARGET_WIN) #if defined(TARGET_WIN)
return memcmp(&mUuid, &right.mUuid, sizeof(mUuid)) < 0; return memcmp(&mUuid, &right.mUuid, sizeof(mUuid)) < 0;
#endif #endif
return false;
} }

View File

@ -21,7 +21,7 @@ namespace MT
{ {
public: public:
Terminal(const CodecList::Settings& codecSettings); Terminal(const CodecList::Settings& codecSettings);
~Terminal(); virtual ~Terminal();
CodecList& codeclist(); CodecList& codeclist();

View File

@ -213,22 +213,22 @@ Logger::endLine()
<< mStream->str().c_str(); << mStream->str().c_str();
std::string t = result.str(); std::string t = result.str();
if (mUseDebugWindow) if (mUseDebugWindow) {
#ifdef TARGET_WIN #ifdef TARGET_WIN
OutputDebugStringA(t.c_str()); OutputDebugStringA(t.c_str());
#elif defined(TARGET_ANDROID) #elif defined(TARGET_ANDROID)
if (t.size() > 512) if (t.size() > 512) {
{ std::string cut = t;
std::string cut = t; cut.erase(480); // Erase tail of string cut.erase(480); // Erase tail of string
cut += "\r\n... [cut]"; cut += "\r\n... [cut]";
__android_log_print(ANDROID_LOG_INFO, "VoipAgent", "%s", cut.c_str()); __android_log_print(ANDROID_LOG_INFO, "VoipAgent", "%s", cut.c_str());
} } else {
else {
__android_log_print(ANDROID_LOG_INFO, "VoipAgent", "%s", t.c_str()); __android_log_print(ANDROID_LOG_INFO, "VoipAgent", "%s", t.c_str());
} }
#else #else
std::cerr << result.str() << std::endl << std::flush; std::cerr << result.str() << std::endl << std::flush;
#endif #endif
}
if (mFile) if (mFile)
{ {
fprintf(mFile, "%s", result.str().c_str()); fprintf(mFile, "%s", result.str().c_str());

View File

@ -354,7 +354,7 @@ static void read_udp_packets(ares_channel channel, int server_idx,
continue; continue;
/* Make sure the server has a socket and is selected in read_fds. */ /* Make sure the server has a socket and is selected in read_fds. */
server = &channel->servers[i]; server = &channel->servers[i];
if ( (server->udp_socket == -1) ) if (server->udp_socket == -1)
continue; continue;
if ( read_fds && !FD_ISSET(server->udp_socket, read_fds) ) if ( read_fds && !FD_ISSET(server->udp_socket, read_fds) )
continue; continue;