changeset 33264:284fc94290b9

Replace all GUI exits by guiExit().
author ib
date Tue, 03 May 2011 12:21:11 +0000
parents 5f527a9a9521
children 62c0471bcf8c
files gui/cfg.c gui/wm/ws.c
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/gui/cfg.c	Tue May 03 12:19:22 2011 +0000
+++ b/gui/cfg.c	Tue May 03 12:21:11 2011 +0000
@@ -262,7 +262,7 @@
 
     if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg) < 0)) {
         mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_ConfigFileError);
-// exit(1);
+// guiExit(1);
     }
 
     free(cfg);
--- a/gui/wm/ws.c	Tue May 03 12:19:22 2011 +0000
+++ b/gui/wm/ws.c	Tue May 03 12:21:11 2011 +0000
@@ -33,6 +33,7 @@
 
 #include <stdint.h>
 
+#include "gui/interface.h"
 #include "config.h"
 #include "libvo/x11_common.h"
 #include "libvo/video_out.h"
@@ -40,6 +41,7 @@
 #include "libswscale/swscale.h"
 #include "libavutil/imgutils.h"
 #include "libmpcodecs/vf_scale.h"
+#include "mp_core.h"
 #include "mp_msg.h"
 #include "help_mp.h"
 #include "mplayer.h"
@@ -209,7 +211,7 @@
  if ( !wsDisplay )
   {
    mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_CouldNotOpenDisplay );
-   exit( 0 );
+   guiExit( EXIT_ERROR );
   }
 }
 
@@ -381,7 +383,7 @@
  if ( depth < 15 )
   {
    mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_ColorDepthTooLow );
-   exit( 0 );
+   guiExit( EXIT_ERROR );
   }
  XMatchVisualInfo( wsDisplay,wsScreen,depth,TrueColor,&win->VisualInfo );
 
@@ -494,7 +496,7 @@
   for ( i=0;i < wsWLCount;i++ )
    if ( wsWindowList[i] == NULL ) break;
   if ( i == wsWLCount )
-   {  mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_TooManyOpenWindows ); exit( 0 ); }
+   {  mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_TooManyOpenWindows ); guiExit( EXIT_ERROR ); }
   wsWindowList[i]=win;
  }
 
@@ -1125,14 +1127,14 @@
    if ( win->xImage == NULL )
     {
      mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_ShmError );
-     exit( 0 );
+     guiExit( EXIT_ERROR );
     }
    win->Shminfo.shmid=shmget( IPC_PRIVATE,win->xImage->bytes_per_line * win->xImage->height,IPC_CREAT|0777 );
    if ( win->Shminfo.shmid < 0 )
     {
      XDestroyImage( win->xImage );
      mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_ShmError );
-     exit( 0 );
+     guiExit( EXIT_ERROR );
     }
    win->Shminfo.shmaddr=(char *)shmat( win->Shminfo.shmid,0,0 );
 
@@ -1141,7 +1143,7 @@
      XDestroyImage( win->xImage );
      if ( win->Shminfo.shmaddr != ((char *) -1) ) shmdt( win->Shminfo.shmaddr );
      mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_ShmError );
-     exit( 0 );
+     guiExit( EXIT_ERROR );
     }
    win->xImage->data=win->Shminfo.shmaddr;
    win->Shminfo.readOnly=0;
@@ -1158,7 +1160,7 @@
     if ( ( win->xImage->data=malloc( win->xImage->bytes_per_line * win->xImage->height ) ) == NULL )
      {
       mp_msg( MSGT_GPLAYER,MSGL_FATAL,MSGTR_WS_NotEnoughMemoryDrawBuffer );
-      exit( 0 );
+      guiExit( EXIT_ERROR );
      }
    }
  win->ImageData=(unsigned char *)win->xImage->data;