From 73dd7f3a7c996370ee37507765062d8ec556ced8 Mon Sep 17 00:00:00 2001 From: Dan Kortschak Date: Fri, 14 Sep 2018 21:33:18 +0930 Subject: [PATCH] rtmp: remove redundant int16 encoder --- rtmp/amf.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/rtmp/amf.go b/rtmp/amf.go index 040cc305..4037ad1a 100644 --- a/rtmp/amf.go +++ b/rtmp/amf.go @@ -99,23 +99,6 @@ func C_AMF_DecodeBoolean(data []byte) bool { return data[0] != 0 } -// char* AMF_EncodeInt16(char* output, char* outend, short nVal); -// amf.c +138 -func C_AMF_EncodeInt16(output *byte, outend *byte, nVal int16) *byte { - outputPtr := unsafe.Pointer(output) - outendPtr := unsafe.Pointer(outend) - if uintptr(outputPtr)+2 > uintptr(outendPtr) { - // length < 2 - return nil - } - // Assign output[1] - second := (*byte)(incBytePtr(outputPtr, 1)) - *second = (byte)(nVal & 0xff) - // Assign output[0] - *output = (byte)(nVal >> 8) - return (*byte)(incBytePtr(outputPtr, 2)) -} - // char* AMF_EncodeInt24(char* output, char* outend, int nVal); // amf.c +149 func C_AMF_EncodeInt24(output *byte, outend *byte, nVal int32) *byte {