diff --git a/controller/audio/AudioPacketSender.cpp b/controller/audio/AudioPacketSender.cpp index 2f32e84..3367c58 100644 --- a/controller/audio/AudioPacketSender.cpp +++ b/controller/audio/AudioPacketSender.cpp @@ -108,7 +108,7 @@ double AudioPacketSender::setPacketLoss(double percent) if (percent > 2) { - resendCount = std::clamp(percent / 2, 0.0, 4.0); + resendCount = std::clamp(percent / 2, 0.0, 3.0); } /*else if (percent > 5) { diff --git a/controller/protocol/Tick.cpp b/controller/protocol/Tick.cpp index f6f053d..f3791f1 100644 --- a/controller/protocol/Tick.cpp +++ b/controller/protocol/Tick.cpp @@ -169,6 +169,7 @@ void VoIPController::UpdateRTT() { waitingForAcks = false; } + LOGI("RTT=%lf", rttHistory[0]) //LOGI("%.3lf/%.3lf, rtt diff %.3lf, waiting=%d, queue=%d", rttHistory[0], rttHistory[8], v, waitingForAcks, sendQueue->Size()); for (auto &stm : incomingStreams) { diff --git a/controller/protocol/packets/PacketStructs.h b/controller/protocol/packets/PacketStructs.h index 8bb42a6..3940892 100644 --- a/controller/protocol/packets/PacketStructs.h +++ b/controller/protocol/packets/PacketStructs.h @@ -140,7 +140,7 @@ public: } std::string print() const override { - std::stringstream res; + std::ostringstream res; res << ((data && data->Length()) ? "Data packet" : extraEC ? "EC packet" : extraSignaling ? "Signaling packet" : nopPacket ? "NOP packet" : "Empty packet"); res << " (seq=" << seq << ", legacySeq=" << legacySeq; #ifdef LOG_PACKETS @@ -205,4 +205,4 @@ struct DebugLoggedPacket int32_t length; }; */ -} // namespace tgvoip \ No newline at end of file +} // namespace tgvoip diff --git a/controller/protocol/protocol/Extra.h b/controller/protocol/protocol/Extra.h index a2c9b98..2d127b8 100644 --- a/controller/protocol/protocol/Extra.h +++ b/controller/protocol/protocol/Extra.h @@ -7,7 +7,7 @@ #define FOURCC(a, b, c, d) ((uint32_t)d | ((uint32_t)c << 8) | ((uint32_t)b << 16) | ((uint32_t)a << 24)) #define PRINT_FOURCC(x) (char)(x >> 24), (char)(x >> 16), (char)(x >> 8), (char)x -#define STRING_FOURCC(x) std::string((char *)&x, 4) +#define STREAM_FOURCC(x) (char)(x >> 24) << (char)(x >> 16) << (char)(x >> 8) << (char)x namespace tgvoip { @@ -57,7 +57,9 @@ public: }; std::string print() const override { - return STRING_FOURCC(codec); + std::ostringstream s; + s << STREAM_FOURCC(codec); + return s.str(); } size_t getSize(const VersionInfo &ver) const override { @@ -90,7 +92,7 @@ public: std::string print() const override { - std::stringstream ss; + std::ostringstream ss; ss << "StreamInfo id=" << (int)streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled; return ss.str(); } @@ -326,7 +328,7 @@ struct ExtraInitAck : public Extra std::string print() const override { - std::stringstream s; + std::ostringstream s; s << "ExtraInitAck (peerVersion=" << peerVersion << ", minVersion=" << minVersion << ", streams: " << streams.print() << ")"; return s.str(); } @@ -373,4 +375,4 @@ struct ExtraPong : public Extra } virtual ~ExtraPong() = default; }; -} // namespace tgvoip \ No newline at end of file +} // namespace tgvoip