Skip to content

Commit

Permalink
make sure files and connections are closed, fixes #33, fixes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed May 1, 2021
1 parent 909307c commit 95dc029
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android/ffmpeg-kit-android-lib/src/main/cpp/saf_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ static AVIOContext *create_fd_avio_context(const char *filename, int flags) {

static void close_fd_avio_context(AVIOContext *ctx) {
if (ctx) {
if (fd_seek(ctx->opaque, 0, AVSEEK_SIZE) >= 0) {
int *fd = ctx->opaque;
int *fd = ctx->opaque;
if (fd_seek((void*)fd, 0, AVSEEK_SIZE) >= 0) {
closeParcelFileDescriptor(*fd);
av_freep(&fd);
ctx->opaque = NULL;
}
ctx->opaque = NULL;
}
}

Expand Down

0 comments on commit 95dc029

Please sign in to comment.