1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-26 12:14:39 +01:00

Avoid backwards compatiblity issues due to reliable ping

This commit is contained in:
Daniil Gentili 2020-03-29 14:51:28 +02:00
parent d2244c5856
commit 18c7f84476
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 3 additions and 2 deletions

View File

@ -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));

View File

@ -189,7 +189,7 @@ void Packet::serializeLegacy(std::vector<std::pair<Buffer, bool>> &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<unsigned char>(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);
}
}