mencoder: call at least a bit of uninit/memory free code.
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 2 Mar 2016 21:33:35 +0000 (21:33 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Wed, 2 Mar 2016 21:33:35 +0000 (21:33 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37826 b3059339-0415-0410-9bf9-f77b7e298cf2

mencoder.c
mpcommon.c
mpcommon.h
mplayer.c

index 1c34457..5faeacb 100644 (file)
@@ -1733,6 +1733,9 @@ if(sh_audio){ uninit_audio(sh_audio);sh_audio=NULL; }
 if(sh_video){ uninit_video(sh_video);sh_video=NULL; }
 if(demuxer) free_demuxer(demuxer);
 if(stream) free_stream(stream); // kill cache thread
+if(mux_v) free(mux_v->buffer);
+if(mux_a) free(mux_a->buffer);
+common_uninit();
 
 return interrupted;
 }
index e774115..ebc9711 100644 (file)
@@ -643,6 +643,26 @@ int common_init(void)
     return 1;
 }
 
+void common_uninit(void)
+{
+#ifdef CONFIG_FREETYPE
+    current_module = "uninit_font";
+    if (sub_font && sub_font != vo_font)
+        free_font_desc(sub_font);
+    sub_font = NULL;
+    if (vo_font)
+        free_font_desc(vo_font);
+    vo_font = NULL;
+    done_freetype();
+#endif
+    free_osd_list();
+
+#ifdef CONFIG_ASS
+    ass_library_done(ass_library);
+    ass_library = NULL;
+#endif
+}
+
 /// Returns a_pts
 double calc_a_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio)
 {
index 8a7a334..bf1739a 100644 (file)
@@ -83,6 +83,7 @@ int cfg_include(m_option_t *conf, const char *filename);
 
 void common_preinit(int *argc_ptr, char **argv_ptr[]);
 int common_init(void);
+void common_uninit(void);
 
 double calc_a_pts(struct sh_audio *sh_audio, demux_stream_t *d_audio);
 
index cb62d55..5494b85 100644 (file)
--- a/mplayer.c
+++ b/mplayer.c
@@ -718,22 +718,7 @@ void exit_player_with_rc(enum exit_reason how, int rc)
     vo_uninit(); // Close the X11 connection (if any is open).
 #endif
 
-#ifdef CONFIG_FREETYPE
-    current_module = "uninit_font";
-    if (sub_font && sub_font != vo_font)
-        free_font_desc(sub_font);
-    sub_font = NULL;
-    if (vo_font)
-        free_font_desc(vo_font);
-    vo_font = NULL;
-    done_freetype();
-#endif
-    free_osd_list();
-
-#ifdef CONFIG_ASS
-    ass_library_done(ass_library);
-    ass_library = NULL;
-#endif
+    common_uninit();
 
     current_module = "exit_player";