mirror of https://bitbucket.org/ausocean/av.git
Fixed some serious bugs
This commit is contained in:
parent
4847728ddf
commit
bb1f63d8bd
28
rtmp/rtmp.go
28
rtmp/rtmp.go
|
@ -184,8 +184,8 @@ var (
|
||||||
av_audioCodecs = AVC("audioCodecs")
|
av_audioCodecs = AVC("audioCodecs")
|
||||||
av_videoCodecs = AVC("videoCodecs")
|
av_videoCodecs = AVC("videoCodecs")
|
||||||
av_videoFunction = AVC("videoFunction")
|
av_videoFunction = AVC("videoFunction")
|
||||||
av_pageUrl = AVC("av_pageUrl")
|
av_pageUrl = AVC("pageUrl")
|
||||||
av_objectEncoding = AVC("av_objectEncoding")
|
av_objectEncoding = AVC("objectEncoding")
|
||||||
)
|
)
|
||||||
|
|
||||||
var packetSize = [...]int{12, 8, 4, 1}
|
var packetSize = [...]int{12, 8, 4, 1}
|
||||||
|
@ -959,9 +959,9 @@ func sendConnectPacket(r *C.RTMP, cp *C.RTMPPacket) int {
|
||||||
|
|
||||||
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
enc = (*byte)(unsafe.Pointer(packet.m_body))
|
||||||
|
|
||||||
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeString((*C.char)(unsafe.Pointer(enc)),
|
//enc = (*byte)(unsafe.Pointer(C.AMF_EncodeString((*C.char)(unsafe.Pointer(enc)),
|
||||||
(*C.char)(unsafe.Pointer(pend)), &av_connect)))
|
//(*C.char)(unsafe.Pointer(pend)), &av_connect)))
|
||||||
// enc = amfEncodeString(enc, pend, &av_connect)
|
enc = amfEncodeString(enc, pend, &av_connect)
|
||||||
r.m_numInvokes += 1
|
r.m_numInvokes += 1
|
||||||
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNumber((*C.char)(unsafe.Pointer(enc)),
|
enc = (*byte)(unsafe.Pointer(C.AMF_EncodeNumber((*C.char)(unsafe.Pointer(enc)),
|
||||||
(*C.char)(unsafe.Pointer(pend)), C.double(r.m_numInvokes))))
|
(*C.char)(unsafe.Pointer(pend)), C.double(r.m_numInvokes))))
|
||||||
|
@ -1728,19 +1728,23 @@ func amfEncodeString(output *byte, outend *byte, bv *C.AVal) *byte {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if bv.av_len < 65536 {
|
if bv.av_len < 65536 {
|
||||||
*(*C.char)(outputPtr) = C.AMF_STRING
|
*(*byte)(outputPtr) = AMF_STRING
|
||||||
incBytePtr(outputPtr, 1)
|
incBytePtr(outputPtr, 1)
|
||||||
outputPtr = unsafe.Pointer(amfEncodeInt16((*byte)(outputPtr),
|
outputPtr = unsafe.Pointer(C.AMF_EncodeInt16((*C.char)(outputPtr), (*C.char)(
|
||||||
(*byte)(outendPtr), (int16)(bv.av_len)))
|
outendPtr), C.short(bv.av_len)))
|
||||||
|
//outputPtr = unsafe.Pointer(amfEncodeInt16((*byte)(outputPtr),
|
||||||
|
//(*byte)(outendPtr), (int16)(bv.av_len)))
|
||||||
} else {
|
} else {
|
||||||
*(*C.char)(outputPtr) = C.AMF_LONG_STRING
|
*(*byte)(outputPtr) = AMF_LONG_STRING
|
||||||
incBytePtr(outputPtr, 1)
|
incBytePtr(outputPtr, 1)
|
||||||
outputPtr = unsafe.Pointer(amfEncodeInt32((*byte)(outputPtr),
|
outputPtr = unsafe.Pointer(C.AMF_EncodeInt32((*C.char)(outputPtr), (*C.char)(
|
||||||
(*byte)(outendPtr), (int32)(bv.av_len)))
|
outendPtr), C.int(bv.av_len)))
|
||||||
|
//outputPtr = unsafe.Pointer(amfEncodeInt32((*byte)(outputPtr),
|
||||||
|
//(*byte)(outendPtr), (int32)(bv.av_len)))
|
||||||
}
|
}
|
||||||
memmove(unsafe.Pointer(outputPtr), unsafe.Pointer(bv.av_val), uintptr(bv.av_len))
|
memmove(unsafe.Pointer(outputPtr), unsafe.Pointer(bv.av_val), uintptr(bv.av_len))
|
||||||
//C.memcpy(unsafe.Pointer(outputPtr), unsafe.Pointer(bv.av_val), (C.size_t)(bv.av_len))
|
//C.memcpy(unsafe.Pointer(outputPtr), unsafe.Pointer(bv.av_val), (C.size_t)(bv.av_len))
|
||||||
incBytePtr(outputPtr, int(bv.av_len))
|
outputPtr = incBytePtr(outputPtr, int(bv.av_len))
|
||||||
return (*byte)(outputPtr)
|
return (*byte)(outputPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue