mirror of
https://github.com/kerberos-io/agent.git
synced 2026-09-07 17:38:33 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ed64edb19 | ||
|
|
e4703fedc3 |
@@ -1527,13 +1527,13 @@ func newDecoder(codecName string) (*Decoder, error) {
|
||||
|
||||
res := C.avcodec_open2(codecCtx, codec, nil)
|
||||
if res < 0 {
|
||||
C.avcodec_close(codecCtx)
|
||||
C.avcodec_free_context(&codecCtx)
|
||||
return nil, fmt.Errorf("avcodec_open2() failed")
|
||||
}
|
||||
|
||||
srcFrame := C.av_frame_alloc()
|
||||
if srcFrame == nil {
|
||||
C.avcodec_close(codecCtx)
|
||||
C.avcodec_free_context(&codecCtx)
|
||||
return nil, fmt.Errorf("av_frame_alloc() failed")
|
||||
}
|
||||
|
||||
@@ -1549,7 +1549,7 @@ func (d *Decoder) Close() {
|
||||
C.av_frame_free(&d.srcFrame)
|
||||
}
|
||||
C.av_frame_free(&d.srcFrame)
|
||||
C.avcodec_close(d.codecCtx)
|
||||
C.avcodec_free_context(&d.codecCtx)
|
||||
}
|
||||
|
||||
func (d *Decoder) decode(nalu []byte) (image.YCbCr, error) {
|
||||
|
||||
Reference in New Issue
Block a user