[SDL] Valgrind testing.

Bill May wmay at cisco.com
Mon Jul 29 18:27:01 PDT 2002


Yes - I've found this tool to be very helpful - doesn't work well in real
time, though, and doesn't support MMX.

Here are some diffs for X11 and yuv.  Note that the last part 2nd diff
should probably be a new call to XvQueryAdaptorFree with ainfo and the number of
adaptors, instead of the loop through like I did.

Index: src/video/XFree86/Xv/Xv.c
===================================================================
RCS file: /vws/pan/mpeg4ip/lib/SDL/src/video/XFree86/Xv/Xv.c,v
retrieving revision 1.1
diff -c -w -r1.1 Xv.c
*** src/video/XFree86/Xv/Xv.c	2002/04/22 21:38:03	1.1
--- src/video/XFree86/Xv/Xv.c	2002/07/29 19:50:18
***************
*** 269,274 ****
--- 269,275 ----

     UnlockDisplay(dpy);
     SyncHandle();
+   Xfree(buffer);

     return (Success);
   }
Index: src/video/x11/SDL_x11yuv.c
===================================================================
RCS file: /vws/pan/mpeg4ip/lib/SDL/src/video/x11/SDL_x11yuv.c,v
retrieving revision 1.4
diff -c -w -r1.4 SDL_x11yuv.c
*** src/video/x11/SDL_x11yuv.c	2002/04/22 21:38:06	1.4
--- src/video/x11/SDL_x11yuv.c	2002/07/29 19:50:18
***************
*** 36,42 ****
   #include <sys/shm.h>
   #include <X11/extensions/XShm.h>
   #include <XFree86/extensions/Xvlib.h>
!
   #include "SDL_error.h"
   #include "SDL_video.h"
   #include "SDL_x11yuv_c.h"
--- 36,42 ----
   #include <sys/shm.h>
   #include <X11/extensions/XShm.h>
   #include <XFree86/extensions/Xvlib.h>
! #include <X11/Xlibint.h>
   #include "SDL_error.h"
   #include "SDL_video.h"
   #include "SDL_x11yuv_c.h"
***************
*** 123,131 ****
--- 123,138 ----
   		 
			}
   		 
		}
   		 
	}
+ 	 
		Xfree(formats);
+ 	 
	}
   		}
   	}
+ 		
+ 	for ( i=0; i < adaptors; ++i ) {
+ 	  if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
+ 	  if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
   	}
+ 	Xfree(ainfo);
   	if ( xv_port == -1 ) {
   		SDL_SetError("No available video ports for requested format");
   		return(NULL);





More information about the SDL mailing list