[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.121,1.122 vo_xv.c,1.122,1.123

Zoltan Ponekker pontscho at mplayerhq.hu
Thu Oct 17 00:44:12 CEST 2002


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv6767/libvo

Modified Files:
	vo_x11.c vo_xv.c 
Log Message:
fix memleak

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- vo_x11.c	16 Oct 2002 22:29:00 -0000	1.121
+++ vo_x11.c	16 Oct 2002 22:44:09 -0000	1.122
@@ -362,9 +362,14 @@
 #endif
    }
 
+  if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc );
   vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
   
-  if ( myximage ) freeMyXImage();
+  if ( myximage )
+   {
+    freeMyXImage();
+    freeSwsContext(swsContext);
+   }
   getMyXImage();
   
   if ( !WinID )

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -r1.122 -r1.123
--- vo_xv.c	16 Oct 2002 19:45:35 -0000	1.122
+++ vo_xv.c	16 Oct 2002 22:44:09 -0000	1.123
@@ -290,7 +290,6 @@
  num_buffers=vo_doublebuffering?(vo_directrendering?NUM_BUFFERS:2):1;
 
    /* check image formats */
-     fo = XvListImageFormats(mDisplay, xv_port, (int*)&formats);
      xv_format=0;
      if(format==IMGFMT_BGR24) format=IMGFMT_YV12;
      for(i = 0; i < formats; i++){
@@ -387,7 +386,7 @@
     } else 
        if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
 
-
+    if ( vo_gc != None ) XFreeGC( mDisplay,vo_gc );
     vo_gc = XCreateGC(mDisplay, vo_window, 0L, &xgcv);
     XFlush(mDisplay);
     XSync(mDisplay, False);




More information about the MPlayer-cvslog mailing list