summaryrefslogtreecommitdiffstats
path: root/libvo/vo_dga.c
diff options
context:
space:
mode:
authoracki2 <acki2@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-17 22:21:47 +0000
committeracki2 <acki2@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-17 22:21:47 +0000
commite330ce9bccde0d8f1adcd84ee1ed8a98270a3da1 (patch)
treee3da2ed3ae9e996db2aff5391795740f512fe00d /libvo/vo_dga.c
parentb24a07ed9c5d7095442994b7c53a2a76a4f45fc5 (diff)
downloadmpv-e330ce9bccde0d8f1adcd84ee1ed8a98270a3da1.tar.bz2
mpv-e330ce9bccde0d8f1adcd84ee1ed8a98270a3da1.tar.xz
- if DGA fails to report some valid modes, vo_dga now exits gracefully
instead of crashing ... (100000x100000 bug ...) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1155 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_dga.c')
-rw-r--r--libvo/vo_dga.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c
index 7b098bc5f2..3aa5fab79d 100644
--- a/libvo/vo_dga.c
+++ b/libvo/vo_dga.c
@@ -23,6 +23,10 @@
* - works only on x86 architectures
*
* $Log$
+ * Revision 1.25 2001/06/17 22:21:47 acki2
+ * - if DGA fails to report some valid modes, vo_dga now exits gracefully
+ * instead of crashing ... (100000x100000 bug ...)
+ *
* Revision 1.24 2001/06/17 20:59:39 acki2
* - doublebuffering now can be switched on and off with the -(no)double switch.
* Default in libvo is disabled.
@@ -155,6 +159,8 @@ static vo_info_t vo_info =
//#define BITSPP (vo_dga_modes[vo_dga_active_mode].vdm_bitspp)
//#define BYTESPP (vo_dga_modes[vo_dga_active_mode].vdm_bytespp)
+#define VO_DGA_INVALID_RES 100000
+
#define HW_MODE (vo_dga_modes[vo_dga_hw_mode])
#define SRC_MODE (vo_dga_modes[vo_dga_src_mode])
@@ -766,7 +772,7 @@ static uint32_t init( uint32_t width, uint32_t height,
#ifdef HAVE_DGA2
// needed to change DGA video mode
- int modecount, mX=100000, mY=100000 , mVBI=100000, mMaxY=0, i,j=0;
+ int modecount, mX=VO_DGA_INVALID_RES, mY=VO_DGA_INVALID_RES , mVBI=100000, mMaxY=0, i,j=0;
int dga_modenum;
XDGAMode *modelines=NULL;
XDGADevice *dgadevice;
@@ -776,7 +782,7 @@ static uint32_t init( uint32_t width, uint32_t height,
unsigned int vm_event, vm_error;
unsigned int vm_ver, vm_rev;
int i, j=0, have_vm=0;
- int modecount, mX=100000, mY=100000, mVBI=100000, mMaxY=0, dga_modenum;
+ int modecount, mX=VO_DGA_INVALID_RES, mY=VO_DGA_INVALID_RES, mVBI=100000, mMaxY=0, dga_modenum;
#endif
int bank, ram;
#endif
@@ -954,7 +960,21 @@ static uint32_t init( uint32_t width, uint32_t height,
#endif
return 1;
}
-
+
+ if(vo_dga_vp_width == VO_DGA_INVALID_RES){
+ vd_printf( VD_ERR, "vo_dga: Something is wrong with your DGA. There doesn't seem to be a\n"
+ "single suitable mode!\n");
+#ifndef HAVE_DGA2
+#ifdef HAVE_XF86VM
+ if(vo_dga_vidmodes){
+ XFree(vo_dga_vidmodes);
+ vo_dga_vidmodes = NULL;
+ }
+#endif
+#endif
+ return 1;
+ }
+
// now lets start the DGA thing
#ifdef HAVE_DGA2