Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Commit cb05fad

Browse files
committed
feat(goavcodec): AVCodecContext.Close & IsOpen
1 parent 645c67b commit cb05fad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

advance/goavcodec/avcodec_context.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,11 @@ func (avctx *AVCodecContext) ParametersTo(par *avcodec.CAVCodecParameters) int {
293293
func (avctx *AVCodecContext) Open(options **avutil.CAVDictionary) int {
294294
return avcodec.AvcodecOpen2(avctx.CAVCodecContext, avctx.CAVCodecContext.GetCodec(), options)
295295
}
296+
297+
func (avctx *AVCodecContext) Close() int {
298+
return avcodec.AvcodecClose(avctx.CAVCodecContext)
299+
}
300+
301+
func (avctx *AVCodecContext) IsOpen() bool {
302+
return avcodec.AvcodecIsOpen(avctx.CAVCodecContext) > 0
303+
}

0 commit comments

Comments
 (0)