[Mplayer-cvslog] CVS: main/libvo vo_vesa.c,1.85,1.86

Arpi of Ize arpi at mplayerhq.hu
Thu Jan 30 00:29:16 CET 2003


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv28405

Modified Files:
	vo_vesa.c 
Log Message:
hopefully better uninit check


Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- vo_vesa.c	5 Jan 2003 11:30:39 -0000	1.85
+++ vo_vesa.c	29 Jan 2003 23:28:55 -0000	1.86
@@ -98,7 +98,7 @@
 static SwsContext * sws = NULL;
 
 static int32_t x_offset,y_offset; /* to center image on screen */
-static unsigned init_mode; /* mode before run of mplayer */
+static unsigned init_mode=0; /* mode before run of mplayer */
 static void *init_state = NULL; /* state before run of mplayer */
 static struct win_frame win; /* real-mode window to video memory */
 static uint8_t *dga_buffer = NULL; /* for yuv2rgb and sw_scaling */
@@ -154,12 +154,15 @@
 #ifdef CONFIG_VIDIX
   else if(vidix_name) vidix_term();
 #endif
-  if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err);
-  if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err);
+  if(init_state) if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err);
+  init_state=NULL;
+  if(init_mode) if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err);
+  init_mode=0;
   if(HAS_DGA()) vbeUnmapVideoBuffer((unsigned long)win.ptr,win.high);
   if(dga_buffer && !HAS_DGA()) free(dga_buffer);
   vbeDestroy();
   if(sws) freeSwsContext(sws);
+  sws=NULL;
 }
 
 #define VALID_WIN_FRAME(offset) (offset >= win.low && offset < win.high)
@@ -993,7 +996,6 @@
 uninit(void)
 {
     // not inited
-    if (!init_state) return;
     vesa_term();
     if(verbose > 2)
         printf("vo_vesa: uninit was called\n");



More information about the MPlayer-cvslog mailing list