Perform the initial audio resync even if we hit the polling timeout

This commit is contained in:
Cameron Gutman 2021-06-19 16:44:48 -05:00
parent c680a60710
commit eff97414bf

View File

@ -268,10 +268,11 @@ static void ReceiveThreadProc(void* context) {
if (!receivedDataFromPeer) { if (!receivedDataFromPeer) {
waitingForAudioMs += UDP_RECV_POLL_TIMEOUT_MS; waitingForAudioMs += UDP_RECV_POLL_TIMEOUT_MS;
} }
else {
// If we hit this path, there are no queued audio packets on the host PC, // If we hit this path, there are no queued audio packets on the host PC,
// so we don't need to drop anything. // so we don't need to drop anything.
packetsToDrop = 0; packetsToDrop = 0;
}
continue; continue;
} }
@ -288,8 +289,9 @@ static void ReceiveThreadProc(void* context) {
if (firstReceiveTime != 0) { if (firstReceiveTime != 0) {
packetsToDrop += (uint32_t)(PltGetMillis() - firstReceiveTime) / AudioPacketDuration; packetsToDrop += (uint32_t)(PltGetMillis() - firstReceiveTime) / AudioPacketDuration;
Limelog("Initial audio resync period: %d milliseconds\n", packetsToDrop * AudioPacketDuration);
} }
Limelog("Initial audio resync period: %d milliseconds\n", packetsToDrop * AudioPacketDuration);
} }
// GFE accumulates audio samples before we are ready to receive them, so // GFE accumulates audio samples before we are ready to receive them, so