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

@ -39,10 +39,6 @@ int create_format_context(AVFormatContext *fmt_ctx, void* opaque, int flags) {
seeker = goPacketSeek;
seekable = 1;
}
if (flags & INTERRUPT_FLAG) {
fmt_ctx->interrupt_callback.callback = goInterrupt;
fmt_ctx->interrupt_callback.opaque = opaque;
}
if (!(avio_ctx = avio_alloc_context(avio_buffer, BUFFER_SIZE, write_flag, opaque, reader, NULL, seeker))) {
av_free(avio_buffer);
avformat_free_context(fmt_ctx);