mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 20:31:29 +02:00
remove blank if and fix ping reply construction
This commit is contained in:
parent
fa1825fa32
commit
7ceacd2751
2 changed files with 4 additions and 5 deletions
|
@ -96,10 +96,6 @@ void AudioInjector::injectAudio() {
|
||||||
// send off this audio packet
|
// send off this audio packet
|
||||||
nodeList->writeDatagram(injectAudioPacket, audioMixer);
|
nodeList->writeDatagram(injectAudioPacket, audioMixer);
|
||||||
|
|
||||||
if (audioMixer && nodeList->getNodeActiveSocketOrPing(audioMixer)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
currentSendPosition += bytesToCopy;
|
currentSendPosition += bytesToCopy;
|
||||||
|
|
||||||
// send two packets before the first sleep so the mixer can start playback right away
|
// send two packets before the first sleep so the mixer can start playback right away
|
||||||
|
|
|
@ -605,13 +605,16 @@ QByteArray NodeList::constructPingReplyPacket(const QByteArray& pingPacket) {
|
||||||
QDataStream pingPacketStream(pingPacket);
|
QDataStream pingPacketStream(pingPacket);
|
||||||
pingPacketStream.skipRawData(numBytesForPacketHeader(pingPacket));
|
pingPacketStream.skipRawData(numBytesForPacketHeader(pingPacket));
|
||||||
|
|
||||||
|
PingType_t typeFromOriginalPing;
|
||||||
|
pingPacketStream >> typeFromOriginalPing;
|
||||||
|
|
||||||
quint64 timeFromOriginalPing;
|
quint64 timeFromOriginalPing;
|
||||||
pingPacketStream >> timeFromOriginalPing;
|
pingPacketStream >> timeFromOriginalPing;
|
||||||
|
|
||||||
QByteArray replyPacket = byteArrayWithPopluatedHeader(PacketTypePingReply);
|
QByteArray replyPacket = byteArrayWithPopluatedHeader(PacketTypePingReply);
|
||||||
QDataStream packetStream(&replyPacket, QIODevice::Append);
|
QDataStream packetStream(&replyPacket, QIODevice::Append);
|
||||||
|
|
||||||
packetStream << timeFromOriginalPing << usecTimestampNow();
|
packetStream << typeFromOriginalPing << timeFromOriginalPing << usecTimestampNow();
|
||||||
|
|
||||||
return replyPacket;
|
return replyPacket;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue