diff --git a/rtmp/RTMP.go b/rtmp/RTMP.go index 87236421..dbf48ada 100644 --- a/rtmp/RTMP.go +++ b/rtmp/RTMP.go @@ -83,9 +83,7 @@ func (s *rtmpSession) StartSession() error { // TODO: Remove mutex func (s *rtmpSession) WriteFrame(data []byte, dataLength uint) error { if s.running { - dataCopy := make([]byte, len(data)) - copy(dataCopy, data) - if !tools.UintToBool(uint(C.RTMP_write_frame((*C.char)(unsafe.Pointer(&dataCopy[0])), C.uint(dataLength)))) { + if !tools.UintToBool(uint(C.RTMP_write_frame((*C.char)(unsafe.Pointer(&data[0])), C.uint(dataLength)))) { return errors.New("RTMP write error! Check rtmp log for details!") } } else {