mirror of https://bitbucket.org/ausocean/av.git
changed redundent data creation
This commit is contained in:
parent
e477ee8a65
commit
51ade541c9
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue