From ae18e00b13903469b81e0e6be825a996aafc06cd Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Mon, 3 Feb 2014 00:30:44 +0100 Subject: [PATCH] Reassemble NAL's early --- .../com/limelight/nvstream/av/video/VideoDepacketizer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/moonlight-common/src/com/limelight/nvstream/av/video/VideoDepacketizer.java b/moonlight-common/src/com/limelight/nvstream/av/video/VideoDepacketizer.java index 61d8a1d2..afb51f09 100644 --- a/moonlight-common/src/com/limelight/nvstream/av/video/VideoDepacketizer.java +++ b/moonlight-common/src/com/limelight/nvstream/av/video/VideoDepacketizer.java @@ -193,6 +193,10 @@ public class VideoDepacketizer { // Add a buffer descriptor describing the NAL data in this packet avcNalDataChain.add(data); avcNalDataLength += location.offset-start; + + // Reassemble the NALs if this was the last packet for this frame + if (packet.getPacketIndex() + 1 == packet.getTotalPackets()) + reassembleAvcNal(); } } }