mirror of https://bitbucket.org/ausocean/av.git
rtmp: simplified C_RTMP_Alloc and zeroed C_RTMP object in C_RTMP_Init
This commit is contained in:
parent
0ed5d4bc72
commit
77393a1de7
|
@ -239,14 +239,14 @@ func C_RTMPPacket_Free(p *C_RTMPPacket) {
|
|||
// RTMP* RTMP_IsConnected();
|
||||
// rtmp.c +317
|
||||
func C_RTMP_Alloc() *C_RTMP {
|
||||
var r C_RTMP
|
||||
return (*C_RTMP)(malloc(uintptr(unsafe.Sizeof(r))))
|
||||
return &C_RTMP{}
|
||||
//return (*C_RTMP)(allocate(unsafe.Sizeof(r)))
|
||||
}
|
||||
|
||||
// void RTMP_Init(RTMP *r);
|
||||
// rtmp.c +329
|
||||
func C_RTMP_Init(r *C_RTMP) {
|
||||
*r = C_RTMP{}
|
||||
r.m_sb.sb_socket = -1
|
||||
r.m_inChunkSize = RTMP_DEFAULT_CHUNKSIZE
|
||||
r.m_outChunkSize = RTMP_DEFAULT_CHUNKSIZE
|
||||
|
|
Loading…
Reference in New Issue