[Mplayer-cvslog] CVS: main mplayer.c,1.481,1.482

Arpi of Ize arpi at mplayerhq.hu
Thu Apr 25 15:27:18 CEST 2002


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

Modified Files:
	mplayer.c 
Log Message:
uninit libvo before getch2 - requires for clean svgalib uninit

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.481
retrieving revision 1.482
diff -u -r1.481 -r1.482
--- mplayer.c	23 Apr 2002 14:27:27 -0000	1.481
+++ mplayer.c	25 Apr 2002 13:27:15 -0000	1.482
@@ -286,6 +286,7 @@
 
   mp_msg(MSGT_CPLAYER,MSGL_DBG2,"\n*** uninit(0x%X)\n",mask);
 
+  // kill the cache process:
   if(mask&INITED_STREAM){
     inited_flags&=~INITED_STREAM;
     current_module="uninit_stream";
@@ -293,6 +294,14 @@
     stream=NULL;
   }
 
+  if(mask&INITED_VO){
+    inited_flags&=~INITED_VO;
+    current_module="uninit_vo";
+    video_out->uninit();
+    video_out=NULL;
+  }
+
+  // must be after libvo uninit, as few vo drivers (svgalib) has tty code
   if(mask&INITED_GETCH2){
     inited_flags&=~INITED_GETCH2;
     current_module="uninit_getch2";
@@ -308,13 +317,6 @@
     vo_spudec=NULL;
   }
 
-  if(mask&INITED_VO){
-    inited_flags&=~INITED_VO;
-    current_module="uninit_vo";
-    video_out->uninit();
-    video_out=NULL;
-  }
-
   if(mask&INITED_AO){
     inited_flags&=~INITED_AO;
     current_module="uninit_ao";
@@ -329,20 +331,20 @@
   }
 #endif
 
-#if defined(HAVE_LIRC) && ! defined(HAVE_NEW_INPUT)
-  if(mask&INITED_LIRC){
-    inited_flags&=~INITED_LIRC;
-    current_module="uninit_lirc";
-    lirc_mp_cleanup();
-  }
-#endif
-
 #ifdef HAVE_NEW_INPUT
   if(mask&INITED_INPUT){
     inited_flags&=INITED_INPUT;
     current_module="uninit_input";
     mp_input_uninit();
   }
+#else
+#ifdef HAVE_LIRC
+  if(mask&INITED_LIRC){
+    inited_flags&=~INITED_LIRC;
+    current_module="uninit_lirc";
+    lirc_mp_cleanup();
+  }
+#endif
 #endif
 
   current_module=NULL;
@@ -364,14 +366,15 @@
 void exit_sighandler(int x){
   static int sig_count=0;
   ++sig_count;
-  if(sig_count==2) exit(1);
-  if(sig_count>2){
+  if(sig_count==5 || (inited_flags==0 && sig_count>1)) exit(1);
+  if(sig_count>5){
     // can't stop :(
     kill(getpid(),SIGKILL);
   }
   mp_msg(MSGT_CPLAYER,MSGL_FATAL,"\n" MSGTR_IntBySignal,x,
       current_module?current_module:mp_gettext("unknown")
   );
+  if(sig_count==1)
   switch(x){
   case SIGINT:
   case SIGQUIT:
@@ -382,7 +385,7 @@
 #ifdef RUNTIME_CPUDETECT
       mp_msg(MSGT_CPLAYER,MSGL_FATAL,"- MPlayer crashed by 'Illegal Instruction'. It may be a bug in our new runtime cpu-detection code... please read DOCS/bugreports.html\n");
 #else
-      mp_msg(MSGT_CPLAYER,MSGL_FATAL,"- MPlayer crashed by 'Illegal Instruction'. It usually happens when you run it on different CPU than it was compiled for. Verify this!\n");
+      mp_msg(MSGT_CPLAYER,MSGL_FATAL,"- MPlayer crashed by 'Illegal Instruction'. It usually happens when you run it on different CPU than it was compiled/optimized for. Verify this!\n");
 #endif
   case SIGFPE:
   case SIGSEGV:




More information about the MPlayer-cvslog mailing list