diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index bf50c0cb..180ebdce 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -1427,19 +1427,13 @@ 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) } - var tbuf, toff *byte for (nSize + hSize) != 0 { if nSize < nChunkSize { 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)) { - return false - } + if !C_WriteN(r, pl2b(header, nChunkSize+hSize)) { + return false } nSize -= 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 // TODO: port the const if packet.m_packetType == RTMP_PACKET_TYPE_INVOKE {