mirror of https://bitbucket.org/ausocean/av.git
Just saving my progress :)
This commit is contained in:
parent
a9b5c7a26f
commit
bc007a09f8
21
rtmp/rtmp.go
21
rtmp/rtmp.go
|
@ -252,7 +252,6 @@ func incPtr(ptr unsafe.Pointer, inc int) unsafe.Pointer {
|
||||||
return unsafe.Pointer(uintptr(ptr) + uintptr(inc))
|
return unsafe.Pointer(uintptr(ptr) + uintptr(inc))
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func sendPacket(r *C.RTMP, pkt *C.RTMPPacket, queue int) int {
|
func sendPacket(r *C.RTMP, pkt *C.RTMPPacket, queue int) int {
|
||||||
const prevPacket *C.RTMPPacket
|
const prevPacket *C.RTMPPacket
|
||||||
last := 0
|
last := 0
|
||||||
|
@ -264,8 +263,26 @@ func sendPacket(r *C.RTMP, pkt *C.RTMPPacket, queue int) int {
|
||||||
var t int32
|
var t int32
|
||||||
var tbuf *C.char = nil
|
var tbuf *C.char = nil
|
||||||
var toff *C.char = nil
|
var toff *C.char = nil
|
||||||
|
|
||||||
|
if packet.m_nChannel >= r.m_channelsAllocatedOut {
|
||||||
|
n := int(packet.m_nChannel+10)
|
||||||
|
packets := C.realloc(r.m_vecChannelsOut, unsafe.Sizeof(*C.RTMPPacket) * n)
|
||||||
|
|
||||||
|
if packets == 0 {
|
||||||
|
C.free(r.m_vecChannelsOut)
|
||||||
|
r.m_vecChannelsOut = nil
|
||||||
|
r.m_channelsAllocatedOut = 0
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
r.m_vecChannelsOut = packets
|
||||||
|
C.memset(r.m_vecChannelsOut + r.m_channelsAllocatedOut, 0,
|
||||||
|
unsafe.Sizeof(*RTMPPacket) * (n-r.m_channelsAllocatedOut))
|
||||||
|
r.m_channelsAllocatedOut = n
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Close terminates the rtmp connection
|
// Close terminates the rtmp connection
|
||||||
func (s *session) Close() error {
|
func (s *session) Close() error {
|
||||||
|
|
Loading…
Reference in New Issue