shithub: aubio

Download patch

ref: 41ebc91ef217ba59d67fd41ba77aace57dc2343d
parent: 8b210a928845d530e9a21284c410a772a8fa7880
author: Paul Brossier <piem@piem.org>
date: Wed Nov 30 12:17:24 EST 2016

src/io/source_avcodec.c: call avformat_free_context after avformat_close_input

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -502,9 +502,10 @@
   }
   s->avCodecCtx = NULL;
   if (s->avFormatCtx != NULL) {
-    avformat_close_input ( &(s->avFormatCtx) );
+    avformat_close_input(&s->avFormatCtx);
+    avformat_free_context(s->avFormatCtx);
+    s->avFormatCtx = NULL;
   }
-  s->avFormatCtx = NULL;
   return AUBIO_OK;
 }