]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
FFmpeg : Close input file and free any related memory if
[ffmpeg] / ffmpeg.c
index 83680786c86ed7874190b11d6a4da3c006ee2908..de15898138cb32a9315aaa194316d60b951d13fa 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1773,13 +1773,11 @@ static int output_packet(AVInputStream *ist, int ist_index,
                         av_free_packet(&opkt);
                     }
                 }
-#if CONFIG_AVFILTER
-                frame_available = (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
-                        ist->out_video_filter && avfilter_poll_frame(ist->out_video_filter->inputs[0]);
-#endif
             }
 
 #if CONFIG_AVFILTER
+            frame_available = (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
+                              ist->out_video_filter && avfilter_poll_frame(ist->out_video_filter->inputs[0]);
             if(ist->picref)
                 avfilter_unref_pic(ist->picref);
         }
@@ -3205,6 +3203,7 @@ static void opt_input_file(const char *filename)
     ret = av_find_stream_info(ic);
     if (ret < 0 && verbose >= 0) {
         fprintf(stderr, "%s: could not find codec parameters\n", filename);
+        av_close_input_file(ic);
         av_exit(1);
     }