changeset 11061:3cf2c7f8d9a9

yet another hack to prevent crashes with dr
author faust3
date Thu, 09 Oct 2003 17:28:16 +0000
parents 052938db5a13
children 42cb00f7209f
files libvo/vo_directx.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Thu Oct 09 15:08:13 2003 +0000
+++ b/libvo/vo_directx.c	Thu Oct 09 17:28:16 2003 +0000
@@ -59,6 +59,7 @@
 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));
 extern int vo_doublebuffering;                      //tribblebuffering    
 extern int vo_fs;
+extern int vo_directrendering;
 
 /*****************************************************************************
  * DirectDraw GUIDs.
@@ -936,6 +937,10 @@
         g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx);
     }	
 	g_lpddsBack->lpVtbl->Lock(g_lpddsBack,NULL,&ddsdsf, DDLOCK_NOSYSLOCK | DDLOCK_WAIT , NULL);
+    if(vo_directrendering && (dstride != ddsdsf.lPitch)){
+      mp_msg(MSGT_VO,MSGL_WARN,"<vo_directx><WARN>stride changed !!!! disabling direct rendering\n");
+      vo_directrendering=0;
+    }
 	dstride = ddsdsf.lPitch;
     image = ddsdsf.lpSurface;
 }