]> git.sesse.net Git - vlc/blobdiff - modules/misc/logger.c
playlist: Handle vlc_InputItemErrorWhenReadingChanged events.
[vlc] / modules / misc / logger.c
index 2cf84a740f79e644a338b00c401d98dfad656d50..4229fa22d8281b9863a2ba36e4f8d3b944369a93 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_interface.h>
 #include <vlc_playlist.h>
@@ -111,12 +111,12 @@ static void DoRRD( intf_thread_t *p_intf );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-static const char *mode_list[] = { "text", "html"
+static const char *const mode_list[] = { "text", "html"
 #ifdef HAVE_SYSLOG_H
 ,"syslog"
 #endif
 };
-static const char *mode_list_text[] = { N_("Text"), "HTML"
+static const char *const mode_list_text[] = { N_("Text"), "HTML"
 #ifdef HAVE_SYSLOG_H
 , "syslog"
 #endif
@@ -167,10 +167,7 @@ static int Open( vlc_object_t *p_this )
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )
-    {
-        msg_Err( p_intf, "out of memory" );
         return -1;
-    }
 
     psz_mode = var_CreateGetString( p_intf, "logmode" );
     if( psz_mode )
@@ -271,6 +268,7 @@ static int Open( vlc_object_t *p_this )
     {
         p_intf->p_sys->p_rrd = utf8_fopen( psz_rrd_file, "w" );
     }
+    free( psz_rrd_file );
 
     p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
     p_intf->pf_run = Run;
@@ -323,7 +321,7 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    while( !p_intf->b_die )
+    while( vlc_object_alive (p_intf) )
     {
         FlushQueue( p_intf->p_sys->p_sub, p_intf->p_sys->p_file,
                     p_intf->p_sys->i_mode,