1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-12-02 09:37:52 +01:00

Fix build for Windows.

This commit is contained in:
John Preston 2018-05-24 19:42:28 +03:00
parent 167259d729
commit 00851dc634
4 changed files with 10 additions and 9 deletions

View File

@ -219,7 +219,7 @@ void JitterBuffer::PutInternal(jitter_packet_t* pkt){
wasReset=false; wasReset=false;
outstandingDelayChange=0; outstandingDelayChange=0;
nextTimestamp=((int64_t)pkt->timestamp)-step*minDelay; nextTimestamp=((int64_t)pkt->timestamp)-step*minDelay;
LOGI("jitter: resyncing, next timestamp = %lld (step=%d, minDelay=%d)", (long long int)nextTimestamp, step, minDelay); LOGI("jitter: resyncing, next timestamp = %lld (step=%d, minDelay=%d)", (long long int)nextTimestamp, step, int(minDelay));
} }
for(i=0;i<JITTER_SLOT_COUNT;i++){ for(i=0;i<JITTER_SLOT_COUNT;i++){
@ -386,7 +386,7 @@ void JitterBuffer::Tick(){
minDelay+=diff; minDelay+=diff;
outstandingDelayChange+=diff*60; outstandingDelayChange+=diff*60;
dontChangeDelay+=32; dontChangeDelay+=32;
LOGD("new delay from stddev %d", minDelay); LOGD("new delay from stddev %d", int(minDelay));
if(diff<0){ if(diff<0){
dontDecMinDelay+=25; dontDecMinDelay+=25;
} }

View File

@ -64,7 +64,7 @@ private:
bool first; bool first;
size_t nextLen; size_t nextLen;
unsigned int packetsPerFrame; unsigned int packetsPerFrame;
ssize_t remainingDataLen; ptrdiff_t remainingDataLen;
}; };
} }

View File

@ -602,7 +602,7 @@ void VoIPGroupController::AddGroupCallParticipant(int32_t userID, unsigned char
//if(streamsLength==0) //if(streamsLength==0)
// return; // return;
MutexGuard m(participantsMutex); MutexGuard m(participantsMutex);
LOGV("Adding group call user %d, streams length %u, streams %X", userID, streamsLength, serializedStreams); //LOGV("Adding group call user %d, streams length %u, streams %X", userID, streamsLength, serializedStreams);
for(std::vector<GroupCallParticipant>::iterator p=participants.begin();p!=participants.end();++p){ for(std::vector<GroupCallParticipant>::iterator p=participants.begin();p!=participants.end();++p){
if(p->userID==userID){ if(p->userID==userID){
@ -1225,11 +1225,11 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint* srcE
uint32_t innerLen=(uint32_t) in.ReadInt32(); uint32_t innerLen=(uint32_t) in.ReadInt32();
if(innerLen>decryptedLen-4){ if(innerLen>decryptedLen-4){
LOGW("Received packet has wrong inner length (%d with total of %u)", innerLen, decryptedLen); LOGW("Received packet has wrong inner length (%d with total of %u)", innerLen, (unsigned int)decryptedLen);
return; return;
} }
if(decryptedLen-innerLen<12){ if(decryptedLen-innerLen<12){
LOGW("Received packet has too little padding (%u)", decryptedLen-innerLen); LOGW("Received packet has too little padding (%u)", (unsigned int)(decryptedLen-innerLen));
return; return;
} }
memcpy(buffer, decrypted+4, innerLen); memcpy(buffer, decrypted+4, innerLen);
@ -1706,7 +1706,7 @@ simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedA
void VoIPGroupController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint *srcEndpoint){ void VoIPGroupController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint *srcEndpoint){
//LOGD("Received incoming packet from %s:%u, %u bytes", packet.address->ToString().c_str(), packet.port, packet.length); //LOGD("Received incoming packet from %s:%u, %u bytes", packet.address->ToString().c_str(), packet.port, packet.length);
if(packet.length<17 || packet.length>2000){ if(packet.length<17 || packet.length>2000){
LOGW("Received packet has wrong length %d", packet.length); LOGW("Received packet has wrong length %d", (int)packet.length);
return; return;
} }
BufferOutputStream sigData(packet.length); BufferOutputStream sigData(packet.length);
@ -1863,11 +1863,11 @@ void VoIPGroupController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint
uint32_t innerLen=(uint32_t) in.ReadInt32(); uint32_t innerLen=(uint32_t) in.ReadInt32();
if(innerLen>decryptedLen-4){ if(innerLen>decryptedLen-4){
LOGW("Received packet has wrong inner length (%d with total of %u)", innerLen, decryptedLen); LOGW("Received packet has wrong inner length (%d with total of %u)", innerLen, (unsigned int)decryptedLen);
return; return;
} }
if(decryptedLen-innerLen<12){ if(decryptedLen-innerLen<12){
LOGW("Received packet has too little padding (%u)", decryptedLen-innerLen); LOGW("Received packet has too little padding (%u)", (unsigned int)(decryptedLen-innerLen));
return; return;
} }
in=BufferInputStream(decrypted+4, (size_t) innerLen); in=BufferInputStream(decrypted+4, (size_t) innerLen);

View File

@ -35,6 +35,7 @@
#ifdef _WIN32 #ifdef _WIN32
#undef GetCurrentTime #undef GetCurrentTime
#undef ERROR_TIMEOUT
#endif #endif
#define TGVOIP_PEER_CAP_GROUP_CALLS 1 #define TGVOIP_PEER_CAP_GROUP_CALLS 1