[Mplayer-cvslog] CVS: main/libvo vo_vesa.c,1.77,1.78

Arpi of Ize arpi at mplayerhq.hu
Tue Sep 10 22:41:16 CEST 2002


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

Modified Files:
	vo_vesa.c 
Log Message:
It prevents mode change when Hsync out of range.
Supports non-countinous Hsync freq spec.

patch by Rudolf Marek <MAREKR2 at cs.felk.cvut.cz>


Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- vo_vesa.c	28 Aug 2002 21:32:32 -0000	1.77
+++ vo_vesa.c	10 Sep 2002 20:41:13 -0000	1.78
@@ -527,6 +527,7 @@
   return i;
 }
 
+
 static int set_refresh(unsigned x, unsigned y, unsigned mode,struct VesaCRTCInfoBlock *crtc_pass)
 {
     unsigned pixclk;
@@ -552,11 +553,12 @@
     
     do
     {
-    H_freq -= 0.1;
+    H_freq -= 0.01;
     GTF_calcTimings(x,y,H_freq,GTF_HF,0, 0,crtc_pass);		      
 //    printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock);    
     }
-    while (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100));
+    while ( (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)||
+	    !in_range(monitor_hfreq,H_freq*1000))&&(H_freq>0));
     
     pixclk = crtc_pass->PixelClock;
 //    printf("PIXclk before %d\n",pixclk);
@@ -575,8 +577,17 @@
     
     printf("RR %d\n",crtc_pass->RefreshRate);
     printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock);*/
+    
+    if (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)||
+	!in_range(monitor_hfreq,H_freq*1000)) {
+        printf( "vo_vesa: Unable to fit the mode into monitor's limitation."
+		" Not changing refresh rate.\n");
+	return 0;
+    }
+
     return 1;
 }
+
 /* fullscreen:
  * bit 0 (0x01) means fullscreen (-fs)
  * bit 1 (0x02) means mode switching (-vm)
@@ -886,11 +897,13 @@
 			PRINT_VBE_ERR("vbeSaveState",err);
 			return -1;
 		}
-		/* TODO: check for VBE 3, monitor limitation
-		         user might pass refresh value
+		
+		/* TODO: 
+		         user might pass refresh value,
 			 GTF constants might be read from monitor
-			 for best results
+			 for best results, I don't have a spec (RM)
 		*/
+		
 		if (((int)(vib.VESAVersion >> 8) & 0xff) > 2) {
 		
 		if (set_refresh(dstW,dstH,video_mode,&crtc_pass))




More information about the MPlayer-cvslog mailing list