add. test codec ctx

master v1.0.21
Baik S. Hyun 4 years ago
parent e26a494c82
commit 8ad7645eb4

@ -585,6 +585,11 @@ func (self *AudioDecoder) Decode(pkt []byte) (gotframe bool, frame av.AudioFrame
cgotframe := C.int(0) cgotframe := C.int(0)
if ff.codecCtx == nil {
err = fmt.Errorf("ffmpeg: Decode ff.codecCtx NULL")
return
}
cerr := C.decode(ff.codecCtx, ff.frame, (*C.uchar)(unsafe.Pointer(&pkt[0])), C.int(len(pkt)), &cgotframe) cerr := C.decode(ff.codecCtx, ff.frame, (*C.uchar)(unsafe.Pointer(&pkt[0])), C.int(len(pkt)), &cgotframe)
if cerr < C.int(0) { if cerr < C.int(0) {

Loading…
Cancel
Save