mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-11 03:20:13 +08:00
将amf0编码器和解码器放到codec/amf.go中,增加MallocSlice函数用于减少内存复制,
对写入avcc音频进行长度判断
This commit is contained in:
@@ -16,3 +16,15 @@ func TestBuffer(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestMallocSlice(t *testing.T) {
|
||||
t.Run(t.Name(), func(t *testing.T) {
|
||||
var a [][]byte = [][]byte{}
|
||||
b := MallocSlice(&a)
|
||||
if *b != nil {
|
||||
t.Fail()
|
||||
} else if *b = []byte{1}; a[0][0] != 1 {
|
||||
t.Fail()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user