]> git.sesse.net Git - vlc/blobdiff - src/interface/intf_msg.c
* Ported Glide and MGA plugins to the new module API. MGA never worked,
[vlc] / src / interface / intf_msg.c
index dcb5b92ea29a917bfba461f6f8e36e8e6fc8a726..68c3b6301bd4f9d43bc8f58b6e7cb8ed2e404491 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
  *
- * Authors:
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
  * 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"
@@ -175,6 +175,11 @@ void intf_MsgDestroy( void )
     }
 #endif
 
+#ifdef INTF_MSG_QUEUE
+    /* destroy lock */
+    vlc_mutex_destroy( &p_main->p_msg->lock );
+#endif
+    
     /* Free structure */
     free( p_main->p_msg );
 }
@@ -219,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 );
@@ -311,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 );
@@ -387,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 )
     {
@@ -397,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 */
@@ -416,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 */