]> git.sesse.net Git - vlc/blobdiff - src/input/input_info.c
* input/input.c, libvlc.h: implemented new way to break vlc preferences :
[vlc] / src / input / input_info.c
index 507e88dbe8184c14a7d899e8dff22b3c486e5d9f..7715d46d12d83208a5619bb2e2d1926b151b30fc 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * input_info.c: Convenient functions to handle the input info structures
  *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_info.c,v 1.10 2003/05/08 19:06:46 titer Exp $
+ * Copyright (C) 1998-2004 VideoLAN
+ * $Id: input_info.c,v 1.14 2004/01/25 17:16:06 zorglub Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -31,7 +31,7 @@
 
 #include "stream_control.h"
 #include "input_ext-intf.h"
-#include "interface.h"
+#include "vlc_interface.h"
 
 /**
  * \brief Find info category by name.
@@ -63,13 +63,13 @@ input_info_category_t * input_InfoCategory( input_thread_t * p_input,
         p_category = malloc( sizeof( input_info_category_t ) );
         if ( !p_category )
         {
-            msg_Err( p_input, "No mem" );
+            msg_Err( p_input, "out of memory" );
             return NULL;
         }
         p_category->psz_name = strdup( psz_name );
         p_category->p_next = NULL;
         p_category->p_info = NULL;
-        p_prev->p_next = p_category;
+        if( p_prev ) p_prev->p_next = p_category;
         return p_category;
     }
 }
@@ -94,9 +94,9 @@ int input_AddInfo( input_info_category_t * p_category, char * psz_name,
     {
         return -1;
     }
-    
+
     va_start( args, psz_format );
-    
+
     /*
      * Convert message to string
      */
@@ -143,13 +143,13 @@ int input_AddInfo( input_info_category_t * p_category, char * psz_name,
  * \internal
  *
  * \param p_input The input thread to be cleaned for info
- * \returns for the moment 0
+ * \returns for the moment VLC_SUCCESS
  */
 int input_DelInfo( input_thread_t * p_input )
 {
     input_info_category_t * p_category, * p_prev_category;
     input_info_t * p_info, * p_prev_info;
-    
+
     p_category = p_input->stream.p_info;
     while ( p_category )
     {
@@ -176,5 +176,5 @@ int input_DelInfo( input_thread_t * p_input )
         p_category = p_category->p_next;
         free( p_prev_category );
     }
-    return 0;
+    return VLC_SUCCESS;
 }