Small fixes to UDP server

merge-requests/2/head
Phil Taylor 2021-03-22 15:16:41 +00:00
rodzic 446ed4ef26
commit 7cb9ae9195
2 zmienionych plików z 15 dodań i 15 usunięć

Wyświetl plik

@ -745,9 +745,11 @@ audioHandler::~audioHandler()
{
stop();
if (audioOutput != Q_NULLPTR) {
audioOutput->stop();
delete audioOutput;
}
if (audioInput != Q_NULLPTR) {
audioInput->stop();
delete audioInput;
}

Wyświetl plik

@ -649,27 +649,25 @@ void udpServer::audioReceived()
current->seqPrefix++;
}
// 0xac is the smallest possible audio packet.
audioPacket tempAudio;
tempAudio.seq = (quint32)current->seqPrefix << 16 | in->seq;
tempAudio.time = QTime::currentTime();;
tempAudio.sent = 0;
tempAudio.datain = r.mid(0x18);
// Prefer signal/slot to forward audio as it is thread/safe
// Need to do more testing but latency appears fine.
//if (hasTxAudio == datagram.senderAddress())
//{
qDebug(logUdpServer()) << "sending tx audio " << in->seq;
if (hasTxAudio == datagram.senderAddress())
{
// 0xac is the smallest possible audio packet.
audioPacket tempAudio;
tempAudio.seq = (quint32)current->seqPrefix << 16 | in->seq;
tempAudio.time = QTime::currentTime();;
tempAudio.sent = 0;
tempAudio.datain = r.mid(0x18);
//qDebug(logUdpServer()) << "sending tx audio " << in->seq;
emit haveAudioData(tempAudio);
//}
//rxaudio->incomingAudio(tempAudio);
}
}
break;
}
}
commonReceived(&audioClients, current, r);
if (current != Q_NULLPTR) {
commonReceived(&audioClients, current, r);
}
}
}