mirror of https://bitbucket.org/ausocean/av.git
Using my amfEncodeNamedBoolean and amfEncodeBoolean - tested and working
This commit is contained in:
parent
a3ceff1a0a
commit
60b88dbf6c
11
rtmp/rtmp.go
11
rtmp/rtmp.go
|
@ -1014,9 +1014,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
|
|||
}
|
||||
|
||||
if r.Link.protocol&RTMP_FEATURE_WRITE == 0 {
|
||||
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedBoolean((*C.char)(
|
||||
unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_fpad, 0)))
|
||||
// enc = amfEncodeNamedBoolean(enc, pend, &av_fpad, 0)
|
||||
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNamedBoolean((*C.char)(
|
||||
//unsafe.Pointer(enc)), (*C.char)(unsafe.Pointer(pend)), &av_fpad, 0)))
|
||||
enc = amfEncodeNamedBoolean(enc, pend, &av_fpad, 0)
|
||||
if enc == nil {
|
||||
return 0
|
||||
}
|
||||
|
@ -1598,7 +1598,7 @@ func amfEncodeNamedBoolean(output *byte, outend *byte, strName *C.AVal, bVal int
|
|||
return nil
|
||||
}
|
||||
output = amfEncodeInt16(output, outend, int16(strName.av_len))
|
||||
memmove(unsafe.Pointer(output), unsafe.Pointer(outend), uintptr(strName.av_len))
|
||||
memmove(unsafe.Pointer(output), unsafe.Pointer(strName.av_val), uintptr(strName.av_len))
|
||||
output = (*byte)(incBytePtr(unsafe.Pointer(output), int(strName.av_len)))
|
||||
return amfEncodeBoolean(output, outend, bVal)
|
||||
}
|
||||
|
@ -1607,13 +1607,14 @@ func amfEncodeBoolean(output *byte, outend *byte, bVal int) *byte {
|
|||
if int(uintptr(unsafe.Pointer(output)))+2 > int(uintptr(unsafe.Pointer(outend))) {
|
||||
return nil
|
||||
}
|
||||
*(*byte)(unsafe.Pointer(output)) = C.AMF_BOOLEAN
|
||||
*(*byte)(unsafe.Pointer(output)) = AMF_BOOLEAN
|
||||
output = (*byte)(incBytePtr(unsafe.Pointer(output), 1))
|
||||
val := byte(0x01)
|
||||
if bVal == 0 {
|
||||
val = byte(0x00)
|
||||
}
|
||||
*(*byte)(unsafe.Pointer(output)) = val
|
||||
output = (*byte)(incBytePtr(unsafe.Pointer(output), 1))
|
||||
return output
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue