Hopefully fix linux issue with new tx audio

merge-requests/2/head
Phil Taylor 2021-02-27 10:11:27 +00:00
rodzic 1fae53f140
commit de0f13c49a
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1044,11 +1044,14 @@ qint64 audioHandler::writeData(const char* data, qint64 len)
qDebug(logAudio) << "*** Small Packet *** " << buffer.length() << " less than " << chunkSize;
}
}
if (!audioBuffer.isEmpty())
{
// Skip through audio buffer deleting any old entry.
auto packet = audioBuffer.begin();
while (packet != audioBuffer.end())
{
// I'm not sure if this is needed?
if (packet->time.msecsTo(QTime::currentTime()) > 100) {
qDebug(logAudio()) << "TX Packet too old " << dec << packet->time.msecsTo(QTime::currentTime()) << "ms";
packet = audioBuffer.erase(packet); // returns next packet
@ -1059,7 +1062,6 @@ qint64 audioHandler::writeData(const char* data, qint64 len)
}
}
return (sentlen); // Always return the same number as we received
}