FFmpeg: Solve memory leak happening on encoding video
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 22 Sep 2015 16:09:39 +0000 (21:09 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 22 Sep 2015 16:11:17 +0000 (21:11 +0500)
source/blender/blenkernel/intern/writeffmpeg.c

index edda852a032a6a5d47d4c397107e9ae79195fc0e..bc734a9a5513d50ad6386045af132847c444fd5e 100644 (file)
@@ -1234,15 +1234,6 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit)
                context->video_stream = 0;
        }
 
-       
-       /* Close the output file */
-       if (context->outfile) {
-               for (i = 0; i < context->outfile->nb_streams; i++) {
-                       if (&context->outfile->streams[i]) {
-                               av_freep(&context->outfile->streams[i]);
-                       }
-               }
-       }
        /* free the temp buffer */
        if (context->current_frame) {
                delete_picture(context->current_frame);
@@ -1254,7 +1245,7 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit)
                }
        }
        if (context->outfile) {
-               av_free(context->outfile);
+               avformat_free_context(context->outfile);
                context->outfile = 0;
        }
        if (context->audio_input_buffer) {