Keep audio mutex until all processing is done

merge-requests/9/head
Phil Taylor 2022-01-07 12:31:15 +00:00
rodzic 6e44480d6b
commit db702123f9
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -1459,8 +1459,6 @@ void udpServer::sendRxAudio()
{
audio.clear();
rxaudio->getNextAudioChunk(audio);
// Now we have the next audio chunk, we can release the mutex.
audioMutex.unlock();
int len = 0;
while (len < audio.length()) {
audioPacket partial;
@ -1468,6 +1466,8 @@ void udpServer::sendRxAudio()
receiveAudioData(partial);
len = len + partial.data.length();
}
// Now we have the next audio chunk, we can release the mutex.
audioMutex.unlock();
}
else {
qInfo(logUdpServer()) << "Unable to lock mutex for rxaudio";