[MPlayer-cvslog] CVS: main/libvo vo_directx.c,1.46,1.47

Sascha Sommer CVS syncmail at mplayerhq.hu
Mon Dec 27 20:27:09 CET 2004


CVS change done by Sascha Sommer CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv14096/libvo

Modified Files:
	vo_directx.c 
Log Message:
win95 does not support GetMonitorInfo

Index: vo_directx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_directx.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- vo_directx.c	23 Dec 2004 12:49:31 -0000	1.46
+++ vo_directx.c	27 Dec 2004 19:27:07 -0000	1.47
@@ -70,6 +70,7 @@
 static GUID *selected_guid_ptr = NULL;
 static RECT monitor_rect;	                        //monitor coordinates 
 static float window_aspect;
+static BOOL (WINAPI* myGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL;
 
 extern void mplayer_put_key(int code);              //let mplayer handel the keyevents 
 extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
@@ -379,9 +380,13 @@
             selected_guid_ptr = &selected_guid;
         }
         mi.cbSize = sizeof(mi);
-        if (GetMonitorInfo(hm, &mi)) {
+        if(myGetMonitorInfo){
+        if (myGetMonitorInfo(hm, &mi)) {
 			monitor_rect = mi.rcMonitor;
         }
+        }else{
+            mp_msg(MSGT_VO, MSGL_ERR, "-adapter is not supported on Win95\n");
+        }
         mp_msg(MSGT_VO, MSGL_INFO ,"\t\t<--");
     }
     mp_msg(MSGT_VO, MSGL_INFO ,"\n");
@@ -397,6 +402,11 @@
  	LPDIRECTDRAW lpDDraw;
 	DDSURFACEDESC2 ddsd;
 	LPDIRECTDRAWENUMERATEEX OurDirectDrawEnumerateEx;
+	HINSTANCE user32dll=LoadLibrary("user32.dll");
+	
+	if(user32dll){
+		myGetMonitorInfo=GetProcAddress(user32dll,"GetMonitorInfo");
+	}
 	
 	mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>Initing DirectDraw\n" );
 
@@ -424,6 +434,7 @@
         if(vo_adapter_num >= adapter_count)
             mp_msg(MSGT_VO, MSGL_ERR,"Selected adapter (%d) doesn't exist: Default Display Adapter selected\n",vo_adapter_num);
     }
+    FreeLibrary(user32dll);
 
 	OurDirectDrawCreateEx = (void *)GetProcAddress(hddraw_dll, "DirectDrawCreateEx");
     if ( OurDirectDrawCreateEx == NULL )




More information about the MPlayer-cvslog mailing list