mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Attempt to fix audio latency issues on some PCs
This commit is contained in:
parent
65047ac0e2
commit
ccaca624f3
@ -195,7 +195,7 @@ static void ReceiveThreadProc(void* context) {
|
|||||||
int waitingForAudioMs;
|
int waitingForAudioMs;
|
||||||
|
|
||||||
packet = NULL;
|
packet = NULL;
|
||||||
packetsToDrop = 0;
|
packetsToDrop = 500 / AudioPacketDuration;
|
||||||
|
|
||||||
if (setNonFatalRecvTimeoutMs(rtpSocket, UDP_RECV_POLL_TIMEOUT_MS) < 0) {
|
if (setNonFatalRecvTimeoutMs(rtpSocket, UDP_RECV_POLL_TIMEOUT_MS) < 0) {
|
||||||
// SO_RCVTIMEO failed, so use select() to wait
|
// SO_RCVTIMEO failed, so use select() to wait
|
||||||
@ -252,7 +252,7 @@ static void ReceiveThreadProc(void* context) {
|
|||||||
Limelog("Received first audio packet after %d ms\n", waitingForAudioMs);
|
Limelog("Received first audio packet after %d ms\n", waitingForAudioMs);
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user