summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-25 13:27:15 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-25 13:27:15 +0000
commit2eac5ee24755050721822c0b473246c0f73392eb (patch)
treea43b0be39d51cad9f367b3d844d6f90d62c71155 /mplayer.c
parentd378366206c8cba64668bc7006e50e8fd2419581 (diff)
downloadmpv-2eac5ee24755050721822c0b473246c0f73392eb.tar.bz2
mpv-2eac5ee24755050721822c0b473246c0f73392eb.tar.xz
uninit libvo before getch2 - requires for clean svgalib uninit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5831 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/mplayer.c b/mplayer.c
index 2dad0505e6..2322f16134 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -286,6 +286,7 @@ void uninit_player(unsigned int mask){
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 @@ void uninit_player(unsigned int mask){
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 @@ void uninit_player(unsigned int mask){
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 @@ void uninit_player(unsigned int mask){
}
#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_player(char* how){
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 @@ void exit_sighandler(int x){
#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: