]> git.sesse.net Git - vlc/blobdiff - src/misc/messages.c
Fixed a (probable) typo in aout_ChangeFilterString().
[vlc] / src / misc / messages.c
index 764d373acc272b49b20106984f71c1f27ea04d8f..8df893ffd63c537bdf7f73a8d0fc19112153a255 100644 (file)
@@ -36,9 +36,9 @@
 
 #include <stdarg.h>                                       /* va_list for BSD */
 #ifdef __APPLE__
-#include <xlocale.h>
-#else
-#include <locale.h>
+# include <xlocale.h>
+#elif defined(HAVE_LOCALE_H)
+# include <locale.h>
 #endif
 #include <errno.h>                                                  /* errno */
 
@@ -442,6 +442,20 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
     for (int i = 0; i < bank->i_sub; i++)
     {
         msg_subscription_t *sub = bank->pp_sub[i];
+        libvlc_priv_t *priv = libvlc_priv( sub->instance );
+        msg_bank_t *bank = priv->msg_bank;
+        void *val = vlc_dictionary_value_for_key( &bank->enabled_objects,
+                                                  p_item->psz_module );
+        if( val == kObjectPrintingDisabled ) continue;
+        if( val != kObjectPrintingEnabled  ) /*if not allowed */
+        {
+            val = vlc_dictionary_value_for_key( &bank->enabled_objects,
+                                                 p_item->psz_object_type );
+            if( val == kObjectPrintingDisabled ) continue;
+            if( val == kObjectPrintingEnabled  ); /* Allowed */
+            else if( !bank->all_objects_enabled ) continue;
+        }
+
         sub->func (sub->opaque, p_item, 0);
     }
     vlc_rwlock_unlock (&bank->lock);
@@ -455,11 +469,11 @@ void msg_GenericVa (vlc_object_t *p_this, int i_type,
  *****************************************************************************/
 static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
 {
-#   define COL(x)  "\033[" #x ";1m"
-#   define RED     COL(31)
-#   define GREEN   COL(32)
-#   define YELLOW  COL(33)
-#   define WHITE   COL(0)
+#   define COL(x,y)  "\033[" #x ";" #y "m"
+#   define RED     COL(31,1)
+#   define GREEN   COL(32,1)
+#   define YELLOW  COL(0,33)
+#   define WHITE   COL(0,1)
 #   define GRAY    "\033[0m"
 
     static const char ppsz_type[4][9] = { "", " error", " warning", " debug" };
@@ -538,14 +552,6 @@ static msg_context_t* GetContext(void)
     return p_ctx;
 }
 
-void msg_StackDestroy (void *data)
-{
-    msg_context_t *p_ctx = data;
-
-    free (p_ctx->psz_message);
-    free (p_ctx);
-}
-
 void msg_StackSet( int i_code, const char *psz_message, ... )
 {
     va_list ap;