changeset 5389:7296c4262457

quick hack to make vo_mga accept multiple calls to config someone else should probably improve on this later
author rfelker
date Fri, 29 Mar 2002 05:03:25 +0000
parents 3af2729c5c87
children 386f6fcc92d5
files libvo/mga_common.c libvo/vo_mga.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/mga_common.c	Fri Mar 29 03:17:57 2002 +0000
+++ b/libvo/mga_common.c	Fri Mar 29 05:03:25 2002 +0000
@@ -9,7 +9,7 @@
 
 static mga_vid_config_t mga_vid_config;
 static uint8_t *vid_data, *frames[4];
-static int f;
+static int f = -1;
 
 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
     int x,y;
@@ -334,6 +334,7 @@
 	ioctl( f,MGA_VID_OFF,0 );
 	munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames);
 	close(f);
+	f = -1;
 }
 
 static uint32_t preinit(const char *arg)
--- a/libvo/vo_mga.c	Fri Mar 29 03:17:57 2002 +0000
+++ b/libvo/vo_mga.c	Fri Mar 29 05:03:25 2002 +0000
@@ -62,6 +62,7 @@
 {
 char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid";
 
+	if (f >= 0) mga_uninit();
 	if(!vo_screenwidth || !vo_screenheight) {
 		int fd;
 		struct fb_var_screeninfo fbinfo;