1
0
mirror of https://github.com/danog/libtgvoip.git synced 2025-01-22 21:11:36 +01:00

more fixes

This commit is contained in:
Grishka 2019-04-25 04:57:50 +03:00
parent bb25caf814
commit 9b78887eaf
2 changed files with 5 additions and 2 deletions

View File

@ -188,6 +188,7 @@ void PacketReassembler::Packet::AddFragment(Buffer pkt, uint32_t fragmentIndex){
parts.push_back(std::move(pkt));
//LOGV("add1");
}else if(parts.size()>fragmentIndex){
assert(parts[fragmentIndex].IsEmpty());
parts[fragmentIndex]=std::move(pkt);
//LOGV("add2");
}else{
@ -197,7 +198,9 @@ void PacketReassembler::Packet::AddFragment(Buffer pkt, uint32_t fragmentIndex){
//LOGV("add3");
}
receivedPartCount++;
assert(parts.size()>=receivedPartCount);
//assert(parts.size()>=receivedPartCount);
if(parts.size()<receivedPartCount)
LOGW("Received %u parts but parts.size is %u", (unsigned int)receivedPartCount, (unsigned int)parts.size());
}
Buffer PacketReassembler::Packet::Reassemble(){

View File

@ -294,7 +294,7 @@ int VideoPacketSender::GetVideoResolutionForCurrentBitrate(){
int peerMaxVideoResolution=GetProtocolInfo().maxVideoResolution;
int resolutionFromBitrate=INIT_VIDEO_RES_1080;
if(VoIPController::GetCurrentTime()-sourceChangeTime<10.0){
if(VoIPController::GetCurrentTime()-sourceChangeTime>10.0){
// TODO: probably move this to server config
if(stm->codec==CODEC_AVC || stm->codec==CODEC_VP8){
if(currentVideoBitrate>400000){