mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove redundant int16 encoder
This commit is contained in:
parent
a2620e003b
commit
73dd7f3a7c
17
rtmp/amf.go
17
rtmp/amf.go
|
@ -99,23 +99,6 @@ func C_AMF_DecodeBoolean(data []byte) bool {
|
||||||
return data[0] != 0
|
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);
|
// char* AMF_EncodeInt24(char* output, char* outend, int nVal);
|
||||||
// amf.c +149
|
// amf.c +149
|
||||||
func C_AMF_EncodeInt24(output *byte, outend *byte, nVal int32) *byte {
|
func C_AMF_EncodeInt24(output *byte, outend *byte, nVal int32) *byte {
|
||||||
|
|
Loading…
Reference in New Issue