mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Increase the default receive buffers for the RTP sockets to avoid dropping packets while the receive thread is suspended by the OS scheduler. Windows uses particularly small (8KB) receive buffers by default which this should work around.
This commit is contained in:
parent
4701c22b67
commit
48f8a05bae
@ -18,6 +18,8 @@ public class AudioStream {
|
||||
public static final int RTP_PORT = 48000;
|
||||
public static final int RTCP_PORT = 47999;
|
||||
|
||||
public static final int RTP_RECV_BUFFER = 64 * 1024;
|
||||
|
||||
private LinkedBlockingQueue<RtpPacket> packets = new LinkedBlockingQueue<RtpPacket>(100);
|
||||
|
||||
private DatagramSocket rtp;
|
||||
@ -87,6 +89,7 @@ public class AudioStream {
|
||||
{
|
||||
rtp = new DatagramSocket(null);
|
||||
rtp.setReuseAddress(true);
|
||||
rtp.setReceiveBufferSize(RTP_RECV_BUFFER);
|
||||
rtp.bind(new InetSocketAddress(RTP_PORT));
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class VideoStream {
|
||||
public static final int FIRST_FRAME_PORT = 47996;
|
||||
|
||||
public static final int FIRST_FRAME_TIMEOUT = 5000;
|
||||
public static final int RTP_RECV_BUFFER = 128 * 1024;
|
||||
|
||||
private LinkedBlockingQueue<RtpPacket> packets = new LinkedBlockingQueue<RtpPacket>(100);
|
||||
|
||||
@ -124,6 +125,7 @@ public class VideoStream {
|
||||
{
|
||||
rtp = new DatagramSocket(null);
|
||||
rtp.setReuseAddress(true);
|
||||
rtp.setReceiveBufferSize(RTP_RECV_BUFFER);
|
||||
rtp.bind(new InetSocketAddress(RTP_PORT));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user