refactor(ffmpeg): cleanup callbacks and increased coverage

This commit is contained in:
Adrian Shum 2022-10-15 14:07:55 +08:00 committed by GitHub
parent 5ff3407305
commit 7367cc4750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 86 additions and 61 deletions

View file

@ -47,19 +47,6 @@ func goPacketSeek(opaque unsafe.Pointer, offset C.int64_t, whence C.int) C.int64
return C.int64_t(n)
}
//export goInterrupt
func goInterrupt(opaque unsafe.Pointer) C.int {
if ctx, ok := pointer.Restore(opaque).(*AVContext); ok {
select {
case <-ctx.context.Done():
return 1
default:
return 0
}
}
return 0
}
//export goAVLoggingHandler
func goAVLoggingHandler(level C.int, cstr *C.char) {
log(AVLogLevel(level), C.GoString(cstr))