From 8235717502fa81da76d29b5b0dbcbbeb21fb7c2a Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jan 2015 21:33:24 -0500 Subject: [PATCH] Fix streaming from GFE 2.1.x --- .../nvstream/av/video/VideoStream.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) 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 a7cbb370..723f2791 100644 --- a/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java +++ b/moonlight-common/src/com/limelight/nvstream/av/video/VideoStream.java @@ -1,7 +1,6 @@ package com.limelight.nvstream.av.video; import java.io.IOException; -import java.io.InputStream; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetSocketAddress; @@ -103,29 +102,11 @@ public class VideoStream { private void readFirstFrame() throws IOException { - byte[] firstFrame = new byte[context.streamConfig.getMaxPacketSize()]; + // We can actually ignore this data. It's the act of gracefully closing the socket + // that matters. - try { - InputStream firstFrameStream = firstFrameSocket.getInputStream(); - - int offset = 0; - for (;;) - { - int bytesRead = firstFrameStream.read(firstFrame, offset, firstFrame.length-offset); - - if (bytesRead == -1) - break; - - offset += bytesRead; - } - - // We can actually ignore this data. It's the act of reading it that matters. - // If this changes, we'll need to move this call before startReceiveThread() - // to avoid state corruption in the depacketizer - } finally { - firstFrameSocket.close(); - firstFrameSocket = null; - } + firstFrameSocket.close(); + firstFrameSocket = null; } public void setupRtpSession() throws SocketException