]> git.sesse.net Git - vlc/blobdiff - modules/misc/logger.c
spatializer: convert to audio filter2
[vlc] / modules / misc / logger.c
index a9da6d94ba877121fdead127036a0f41dc2ea827..9a7e1bc2fd717b316a1751aaf02f1ca5f0f7d283 100644 (file)
 
 #include <assert.h>
 
-#ifdef UNDER_CE
-#   define _IONBF 0x0004
-#endif
-
 #define MODE_TEXT 0
 #define MODE_HTML 1
 #define MODE_SYSLOG 2
@@ -72,7 +68,7 @@
     "  </body>\n" \
     "</html>\n"
 
-#if HAVE_SYSLOG_H
+#ifdef HAVE_SYSLOG_H
 #include <syslog.h>
 #endif
 
@@ -234,10 +230,13 @@ static int Open( vlc_object_t *p_this )
         if( !psz_file )
         {
 #ifdef __APPLE__
-            if( asprintf( &psz_file, "%s/"LOG_DIR"/%s", config_GetHomeDir(),
+            char *home = config_GetUserDir(VLC_DOCUMENTS_DIR);
+            if( home == NULL
+             || asprintf( &psz_file, "%s/"LOG_DIR"/%s", home,
                 (p_sys->msg.i_mode == MODE_HTML) ? LOG_FILE_HTML
                                              : LOG_FILE_TEXT ) == -1 )
                 psz_file = NULL;
+            free(home);
 #else
             switch( p_sys->msg.i_mode )
             {
@@ -285,8 +284,7 @@ static int Open( vlc_object_t *p_this )
         p_sys->msg.p_file = NULL;
 #ifdef HAVE_SYSLOG_H
         int i_facility;
-        const char *const psz_facility =
-                             var_CreateGetString( p_intf, "syslog-facility" );
+        char *psz_facility = var_CreateGetString( p_intf, "syslog-facility" );
         if( psz_facility )
         {
             bool b_valid = 0;
@@ -364,6 +362,7 @@ static void Close( vlc_object_t *p_this )
  */
 static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overruns)
 {
+    VLC_UNUSED(overruns);
     int verbosity = var_CreateGetInteger( p_sys->p_intf, "verbose" );
     int priority = 0;
 
@@ -375,6 +374,8 @@ static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overrun
     if (verbosity < priority)
         return;
 
+    int canc = vlc_savecancel();
+
     switch( p_sys->i_mode )
     {
         case MODE_HTML:
@@ -390,6 +391,8 @@ static void Overflow (msg_cb_data_t *p_sys, msg_item_t *p_item, unsigned overrun
             TextPrint( p_item, p_sys->p_file );
             break;
     }
+
+    vlc_restorecancel( canc );
 }
 
 static const char ppsz_type[4][11] = {