mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Fix streaming from GFE 2.1.x
This commit is contained in:
parent
3d29d76cd4
commit
8235717502
@ -1,7 +1,6 @@
|
|||||||
package com.limelight.nvstream.av.video;
|
package com.limelight.nvstream.av.video;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
import java.net.DatagramSocket;
|
import java.net.DatagramSocket;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@ -103,30 +102,12 @@ public class VideoStream {
|
|||||||
|
|
||||||
private void readFirstFrame() throws IOException
|
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.close();
|
||||||
firstFrameSocket = null;
|
firstFrameSocket = null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void setupRtpSession() throws SocketException
|
public void setupRtpSession() throws SocketException
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user