mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove http-specific code
This commit is contained in:
parent
5203982233
commit
ac15477af1
15
rtmp/rtmp.go
15
rtmp/rtmp.go
|
@ -1427,20 +1427,14 @@ func C_RTMP_SendPacket(r *C_RTMP, packet *C_RTMPPacket, queue int) (ok bool) {
|
||||||
log.Printf("C_RTMP_SendPacket: fd=%v, size=%v", r.m_sb.sb_socket, nSize)
|
log.Printf("C_RTMP_SendPacket: fd=%v, size=%v", r.m_sb.sb_socket, nSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
var tbuf, toff *byte
|
|
||||||
for (nSize + hSize) != 0 {
|
for (nSize + hSize) != 0 {
|
||||||
if nSize < nChunkSize {
|
if nSize < nChunkSize {
|
||||||
nChunkSize = nSize
|
nChunkSize = nSize
|
||||||
}
|
}
|
||||||
|
|
||||||
if tbuf != nil {
|
|
||||||
copy(pl2b(toff, nChunkSize+hSize), pl2b(header, nChunkSize+hSize))
|
|
||||||
toff = incBytePtr(toff, nChunkSize+hSize)
|
|
||||||
} else {
|
|
||||||
if !C_WriteN(r, pl2b(header, nChunkSize+hSize)) {
|
if !C_WriteN(r, pl2b(header, nChunkSize+hSize)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
nSize -= nChunkSize
|
nSize -= nChunkSize
|
||||||
buffer = incBytePtr(buffer, nChunkSize)
|
buffer = incBytePtr(buffer, nChunkSize)
|
||||||
|
@ -1477,15 +1471,6 @@ func C_RTMP_SendPacket(r *C_RTMP, packet *C_RTMPPacket, queue int) (ok bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if tbuf != nil {
|
|
||||||
ok := C_WriteN(r, pp2b(tbuf, toff))
|
|
||||||
tbuf = nil
|
|
||||||
|
|
||||||
if !ok {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We invoked a remote method
|
// We invoked a remote method
|
||||||
// TODO: port the const
|
// TODO: port the const
|
||||||
if packet.m_packetType == RTMP_PACKET_TYPE_INVOKE {
|
if packet.m_packetType == RTMP_PACKET_TYPE_INVOKE {
|
||||||
|
|
Loading…
Reference in New Issue