From 18c7f84476e997f0168b92c7763dfce44186dd6b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 29 Mar 2020 14:51:28 +0200 Subject: [PATCH] Avoid backwards compatiblity issues due to reliable ping --- controller/protocol/Tick.cpp | 1 + controller/protocol/packets/Legacy.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/controller/protocol/Tick.cpp b/controller/protocol/Tick.cpp index f3791f1..e69b773 100644 --- a/controller/protocol/Tick.cpp +++ b/controller/protocol/Tick.cpp @@ -283,6 +283,7 @@ void VoIPController::UpdateAudioBitrate() } else if (act == TGVOIP_CONCTL_ACT_DECREASE) { + LOGE("==== DECREASING BITRATE ======"); uint32_t bitrate = encoder->GetBitrate(); if (bitrate > 8000) encoder->SetBitrate(bitrate < (minAudioBitrate + audioBitrateStepDecr) ? minAudioBitrate : (bitrate - audioBitrateStepDecr)); diff --git a/controller/protocol/packets/Legacy.cpp b/controller/protocol/packets/Legacy.cpp index ded6bd1..de4bab6 100644 --- a/controller/protocol/packets/Legacy.cpp +++ b/controller/protocol/packets/Legacy.cpp @@ -189,7 +189,7 @@ void Packet::serializeLegacy(std::vector> &outArray, con writePacketHeaderLegacyLegacy(out, ver, legacySeq, ackSeq, ackMask, type, accumulator.GetLength(), allowedExtras, state, callID); out.WriteBytes(accumulator.GetBuffer(), accumulator.GetLength()); } - outArray.push_back(std::make_pair(Buffer(std::move(out)), true)); + outArray.push_back(std::make_pair(Buffer(std::move(out)), !(type == PKT_PING || type == PKT_PONG))); legacySeq++; } // Convert from mask to array @@ -318,7 +318,7 @@ void Packet::writePacketHeaderLegacy(BufferOutputStream &out, const VersionInfo out.WriteByte(static_cast(extras.size())); for (auto &x : extras) { - LOGV("Writing extra into header: type %u", x.getID()); + //LOGV("Writing extra into header: type %u", x.getID()); out.Write(x, ver); } }