diff --git a/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java b/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java index 061268d7..c0b073e7 100644 --- a/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java +++ b/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java @@ -25,6 +25,11 @@ public class VideoStream { public static final int FIRST_FRAME_TIMEOUT = 5000; public static final int RTP_RECV_BUFFER = 256 * 1024; + // We can't request an IDR frame until the depacketizer knows + // that a packet was lost. This timeout bounds the time that + // the RTP queue will wait for missing/reordered packets. + public static final int MAX_RTP_QUEUE_DELAY_MS = 10; + // The ring size MUST be greater than or equal to // the maximum number of packets in a fully // presentable frame @@ -201,7 +206,7 @@ public class VideoStream { VideoPacket ring[] = new VideoPacket[VIDEO_RING_SIZE]; VideoPacket queuedPacket; int ringIndex = 0; - RtpReorderQueue rtpQueue = new RtpReorderQueue(); + RtpReorderQueue rtpQueue = new RtpReorderQueue(16, MAX_RTP_QUEUE_DELAY_MS); RtpReorderQueue.RtpQueueStatus queueStatus; // Preinitialize the ring buffer