From a5dfcdf1576f5da33d57469ac939d095e87954fc Mon Sep 17 00:00:00 2001 From: rfelker Date: Fri, 29 Mar 2002 05:03:25 +0000 Subject: [PATCH] quick hack to make vo_mga accept multiple calls to config someone else should probably improve on this later git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5390 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/mga_common.c | 3 ++- libvo/vo_mga.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libvo/mga_common.c b/libvo/mga_common.c index 53b5845d3e..0f1c4c6b42 100644 --- a/libvo/mga_common.c +++ b/libvo/mga_common.c @@ -9,7 +9,7 @@ static int mga_next_frame=0; 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 @@ static int mga_uninit(){ 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) diff --git a/libvo/vo_mga.c b/libvo/vo_mga.c index 9eaa6c5190..b7c9d361cf 100644 --- a/libvo/vo_mga.c +++ b/libvo/vo_mga.c @@ -62,6 +62,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin { 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;