From 51ade541c9f490fca0e6cb2c519a5d1f11fd3f56 Mon Sep 17 00:00:00 2001 From: Saxon1 Date: Thu, 3 May 2018 15:08:10 +0930 Subject: [PATCH] changed redundent data creation --- rtmp/RTMP.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 {