From 415e96dec68b950e888e2b4069f51db2f9726075 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 10 Oct 2014 22:15:21 -0700 Subject: [PATCH] Fix endianness of integer SDP attributes. Fix transferProtocol attributes. --- .../src/com/limelight/nvstream/rtsp/SdpGenerator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java index 53484c8d..054ec715 100644 --- a/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java +++ b/moonlight-common/src/com/limelight/nvstream/rtsp/SdpGenerator.java @@ -20,7 +20,7 @@ public class SdpGenerator { } private static void addSessionAttributeInt(StringBuilder config, String attribute, int value) { - ByteBuffer b = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN); + ByteBuffer b = ByteBuffer.allocate(4).order(ByteOrder.BIG_ENDIAN); b.putInt(value); addSessionAttributeBytes(config, attribute, b.array()); } @@ -51,10 +51,10 @@ public class SdpGenerator { addSessionAttribute(config, "x-nv-video[0].clientViewportHt", ""+sc.getHeight()); addSessionAttribute(config, "x-nv-video[0].maxFPS", ""+sc.getRefreshRate()); - addSessionAttributeInt(config, "x-nv-video[0].transferProtocol", 0x41514120); - addSessionAttributeInt(config, "x-nv-video[1].transferProtocol", 0x41514120); - addSessionAttributeInt(config, "x-nv-video[2].transferProtocol", 0x41514120); - addSessionAttributeInt(config, "x-nv-video[3].transferProtocol", 0x41514120); + addSessionAttributeInt(config, "x-nv-video[0].transferProtocol", 0x41514141); + addSessionAttributeInt(config, "x-nv-video[1].transferProtocol", 0x41514141); + addSessionAttributeInt(config, "x-nv-video[2].transferProtocol", 0x41514141); + addSessionAttributeInt(config, "x-nv-video[3].transferProtocol", 0x41514141); addSessionAttributeInt(config, "x-nv-video[0].rateControlMode", 0x42414141); addSessionAttributeInt(config, "x-nv-video[1].rateControlMode", 0x42514141);