refactor(ffmpeg): cleanup callbacks and increased coverage
This commit is contained in:
parent
5ff3407305
commit
7367cc4750
6 changed files with 86 additions and 61 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue