[MPlayer-dev-eng] [PATCH] really clear vidix on start

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Dec 5 21:01:48 CET 2005


Hello,
currently the vidix vos upon startup only clear the frame to grey
instead of black. It seems (from what I guess from a user report) that
in case of ATI cards it doesn't get cleared at all currently??
It is best to see when playing a video with -fps 1.
Attached patch should fix it.
Please comment, I will apply soon.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libvo/vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.64
diff -u -r1.64 vosub_vidix.c
--- libvo/vosub_vidix.c	28 Oct 2004 01:15:52 -0000	1.64
+++ libvo/vosub_vidix.c	5 Dec 2005 19:54:42 -0000
@@ -404,6 +404,7 @@
 		   unsigned dst_height,unsigned format,unsigned dest_bpp,
 		   unsigned vid_w,unsigned vid_h)
 {
+  void *tmp, *tmpa;
   size_t i;
   int err;
   uint32_t sstride,apitch;
@@ -495,14 +496,22 @@
 
 	vidix_mem = vidix_play.dga_addr;
 
-	/* select first frame */
-	next_frame = 0;
-//        vdlPlaybackFrameSelect(vidix_handler,next_frame);
-
+	tmp = calloc(image_width, image_height);
+	tmpa = malloc(image_width * image_height);
+	memset(tmpa, 1, image_width * image_height);
 	/* clear every frame with correct address and frame_size */
-	for (i = 0; i < vidix_play.num_frames; i++)
+	/* HACK: use draw_alpha to clear Y component */
+	for (i = 0; i < vidix_play.num_frames; i++) {
+	    next_frame = i;
 	    memset(vidix_mem + vidix_play.offsets[i], 0x80,
 		vidix_play.frame_size);
+	    draw_alpha(0, 0, image_width, image_height, tmp, tmpa, image_width);
+	}
+	free(tmp);
+	free(tmpa);
+	/* show one of the "clear" frames */
+	vidix_flip_page();
+
 	switch(format)
 	{
 	    case IMGFMT_YV12:


More information about the MPlayer-dev-eng mailing list