[MPlayer-dev-eng] [PATCH] mplayer memory leak and playlists

Pierre Lombard p_l at gmx.fr
Fri Sep 26 19:35:46 CEST 2003


Hi ,

A memory leak was reported in :
26/09 roderick Jansen [MPlayer-users] Bug: memory leak in MPlayer 

Is it OK to apply the attached patch ?

The fix isn't complete IMO there seem to be some other leaks (but they
seem to leak more slowly with my test).


To reproduce:
Make a 10s x.avi 
x.pls contains 100 times x.avi (perl -e 'print "x.avi\n"x100;'>x.pls)

./mplayer -ao null -vo xv -hardframedrop -fps 400 -playlist x.pls

then look at RES usage in top.

-- 
Best regards,
  Pierre Lombard
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.728
diff -u -r1.728 mplayer.c
--- mplayer.c	22 Sep 2003 11:31:27 -0000	1.728
+++ mplayer.c	26 Sep 2003 17:59:04 -0000
@@ -1270,8 +1270,14 @@
 
   stream=NULL;
   demuxer=NULL;
-  d_audio=NULL;
-  d_video=NULL;
+  if (d_audio) {
+    free_demuxer_stream(d_audio);
+    d_audio=NULL;
+  }
+  if (d_video) {
+    free_demuxer_stream(d_video);
+    d_video=NULL;
+  }
   sh_audio=NULL;
   sh_video=NULL;
 


More information about the MPlayer-dev-eng mailing list