From 12e76ed3db5307de45e2186c66d3ea9fbf235930 Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 3 Jan 2019 16:51:14 +0300 Subject: [PATCH] better logging --- VoIPController.cpp | 7 ++++--- VoIPController.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VoIPController.cpp b/VoIPController.cpp index 3da40d3..8ea0472 100755 --- a/VoIPController.cpp +++ b/VoIPController.cpp @@ -231,6 +231,7 @@ VoIPController::VoIPController() : activeNetItfName(""), rateMaxAcceptableRTT=ServerConfig::GetSharedInstance()->GetDouble("rate_min_rtt", 0.6); rateMaxAcceptableSendLoss=ServerConfig::GetSharedInstance()->GetDouble("rate_min_send_loss", 0.2); packetLossToEnableExtraEC=ServerConfig::GetSharedInstance()->GetDouble("packet_loss_for_extra_ec", 0.02); + maxUnsentStreamPackets=static_cast(ServerConfig::GetSharedInstance()->GetInt("max_unsent_stream_packets", 2)); #ifdef __APPLE__ machTimestart=0; @@ -1017,14 +1018,14 @@ void VoIPController::HandleAudioInput(unsigned char *data, size_t len, unsigned if(stopping) return; unsentStreamPacketsHistory.Add(static_cast(unsentStreamPackets)); - if(unsentStreamPacketsHistory.Average()>=2){ + if(unsentStreamPacketsHistory.Average()>=maxUnsentStreamPackets){ LOGW("Resetting stalled send queue"); sendQueue.clear(); unsentStreamPacketsHistory.Reset(); unsentStreamPackets=0; } - if(waitingForAcks || dontSendPackets>0 || (unsigned int)unsentStreamPackets>=2){ - LOGV("waiting for queue, dropping outgoing audio packet"); + if(waitingForAcks || dontSendPackets>0 || ((unsigned int)unsentStreamPackets>=maxUnsentStreamPackets /*&& endpoints[currentEndpoint].type==Endpoint::Type::TCP_RELAY*/)){ + LOGV("waiting for queue, dropping outgoing audio packet, %d %d %d [%d]", (unsigned int)unsentStreamPackets, waitingForAcks, dontSendPackets, maxUnsentStreamPackets); return; } //LOGV("Audio packet size %u", (unsigned int)len); diff --git a/VoIPController.h b/VoIPController.h index d348448..52e3448 100755 --- a/VoIPController.h +++ b/VoIPController.h @@ -759,6 +759,7 @@ namespace tgvoip{ double rateMaxAcceptableRTT; double rateMaxAcceptableSendLoss; double packetLossToEnableExtraEC; + uint32_t maxUnsentStreamPackets; public: #ifdef __APPLE__