ffmpeg: free threads on error conditions.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 14 May 2013 23:08:18 +0000 (01:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 14 May 2013 23:28:59 +0000 (01:28 +0200)
Fixes Ticket2562

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 15c2a29..785c334 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -162,6 +162,8 @@ static struct termios oldtty;
 static int restore_tty;
 #endif
 
+static void free_input_threads(void);
+
 
 /* sub2video hack:
    Convert subtitles to video with alpha to insert them in filter graphs.
@@ -474,6 +476,9 @@ static void exit_program(void)
         av_freep(&output_streams[i]->logfile_prefix);
         av_freep(&output_streams[i]);
     }
+#if HAVE_PTHREADS
+    free_input_threads();
+#endif
     for (i = 0; i < nb_input_files; i++) {
         avformat_close_input(&input_files[i]->ctx);
         av_freep(&input_files[i]);