X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Finterface%2Fintf_msg.c;h=68c3b6301bd4f9d43bc8f58b6e7cb8ed2e404491;hb=583c6553f6761421260d86bbc21b5b3169c04319;hp=9a8d709012254beff498537df9af2f8d6a2ed3d0;hpb=3ce24ee9dd032e9a3b644dd2d35d8ae128a6eb43;p=vlc diff --git a/src/interface/intf_msg.c b/src/interface/intf_msg.c index 9a8d709012..68c3b6301b 100644 --- a/src/interface/intf_msg.c +++ b/src/interface/intf_msg.c @@ -5,7 +5,7 @@ ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN * - * Authors: + * Authors: Vincent Seguin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ #include "common.h" #include "threads.h" #include "mtime.h" -#include "plugins.h" + #include "intf_msg.h" #include "interface.h" #include "intf_console.h" @@ -224,7 +224,7 @@ void intf_WarnMsg( int i_level, char *psz_format, ... ) { va_list ap; - if( i_level >= p_main->p_intf->i_warning_level ) + if( i_level >= p_main->i_warning_level ) { va_start( ap, psz_format ); QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap ); @@ -316,7 +316,7 @@ void intf_WarnMsgImm( int i_level, char *psz_format, ... ) { va_list ap; - if( i_level >= p_main->p_intf->i_warning_level ) + if( i_level >= p_main->i_warning_level ) { va_start( ap, psz_format ); QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap ); @@ -392,7 +392,6 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a vasprintf( &psz_str, psz_format, ap ); #else psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE ); - vsprintf( psz_str, psz_format, ap ); #endif if( psz_str == NULL ) { @@ -402,6 +401,10 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a fprintf(stderr, "\n" ); exit( errno ); } +#ifdef HAVE_VASPRINTF +#else + vsprintf( psz_str, psz_format, ap ); +#endif #ifdef INTF_MSG_QUEUE /*...................................... queue mode ...*/ vlc_mutex_lock( &p_msg->lock ); /* get lock */ @@ -421,7 +424,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a p_msg_item->i_type = i_type; p_msg_item->psz_msg = psz_str; #ifdef DEBUG - p_msg_item->date = mdate(); + p_msg_item->date = mdate(); #endif #ifdef INTF_MSG_QUEUE /*......................................... queue mode */