summaryrefslogtreecommitdiffstats
path: root/mp_msg.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-09-26 18:40:57 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-09-26 18:40:57 +0000
commit8f7170e9dd29215ec75400347bca23c6c19dbb73 (patch)
treee9894d144ce381a9e4d70818f817cb0df6ba6810 /mp_msg.c
parent4b390a955ff1d923da9ec288f555cfabe00c325c (diff)
downloadmpv-8f7170e9dd29215ec75400347bca23c6c19dbb73.tar.bz2
mpv-8f7170e9dd29215ec75400347bca23c6c19dbb73.tar.xz
cleanup
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1972 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mp_msg.c')
-rw-r--r--mp_msg.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/mp_msg.c b/mp_msg.c
index 7b0c3f8df6..447b5f8061 100644
--- a/mp_msg.c
+++ b/mp_msg.c
@@ -26,44 +26,38 @@ void mp_msg_init(int verbose){
void mp_msg_c( int x, const char *format, ... ){
va_list va;
- char tmp[8*80];
if((x&255)>mp_msg_levels[x>>8]) return; // do not display
va_start(va, format);
- vsnprintf( tmp,128,format,va );
-/*
- if((x&255)<=MSGL_ERR){
-// fprintf(stderr,"%%%%%% ");
- vfprintf(stderr,format, va);
- } else {
-// printf("%%%%%% ");
- vprintf(format, va);
- }
-*/
- va_end(va);
- switch( x&255 )
- {
+#ifdef HAVE_NEW_GUI
+ if(use_gui){
+ char tmp[8*80];
+ vsnprintf( tmp,8*80,format,va ); tmp[8*80-1]=0;
+ switch( x&255 ) {
case MSGL_FATAL:
fprintf( stderr,"%s",tmp );
- #ifdef HAVE_NEW_GUI
- if ( use_gui ) gtkMessageBox( GTK_MB_FATAL|GTK_MB_SIMPLE,tmp );
- #endif
+ gtkMessageBox( GTK_MB_FATAL|GTK_MB_SIMPLE,tmp );
break;
case MSGL_ERR:
fprintf( stderr,"%s",tmp );
- #ifdef HAVE_NEW_GUI
- if ( use_gui ) gtkMessageBox( GTK_MB_ERROR|GTK_MB_SIMPLE,tmp );
- #endif
+ gtkMessageBox( GTK_MB_ERROR|GTK_MB_SIMPLE,tmp );
break;
case MSGL_WARN:
printf( "%s",tmp );
- #ifdef HAVE_NEW_GUI
- if ( use_gui ) gtkMessageBox( GTK_MB_WARNING|GTK_MB_SIMPLE,tmp );
- #endif
+ gtkMessageBox( GTK_MB_WARNING|GTK_MB_SIMPLE,tmp );
break;
default:
printf( "%s",tmp );
- break;
- }
+ }
+ } else
+#endif
+ if((x&255)<=MSGL_ERR){
+// fprintf(stderr,"%%%%%% ");
+ vfprintf(stderr,format, va);
+ } else {
+// printf("%%%%%% ");
+ vprintf(format, va);
+ }
+ va_end(va);
}
#else