]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/qtl.c
Remove FREE() macro, since free() does the same internally
[vlc] / modules / demux / playlist / qtl.c
index 3f499a8292296b164bee90249c17ab1cadd3f55a..4cdc1bea4a7848b890f1a7874c774340fb4b16f6 100644 (file)
@@ -47,11 +47,9 @@ volume - 0 (mute) - 100 (max)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <ctype.h>                                              /* isspace() */
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
+#include <vlc_demux.h>
 
 #include "playlist.h"
 #include "vlc_xml.h"
@@ -59,8 +57,7 @@ volume - 0 (mute) - 100 (max)
 struct demux_sys_t
 {
     playlist_t *p_playlist;
-    playlist_item_t *p_current;
-    playlist_item_t *p_item_in_category;
+    input_item_t *p_current_input;
 
     xml_t *p_xml;
     xml_reader_t *p_xml_reader;
@@ -71,11 +68,11 @@ typedef enum { FULLSCREEN_NORMAL,
                FULLSCREEN_HALF,
                FULLSCREEN_CURRENT,
                FULLSCREEN_FULL } qtl_fullscreen_t;
-char* ppsz_fullscreen[] = { "normal", "double", "half", "current", "full" };
+const char* ppsz_fullscreen[] = { "normal", "double", "half", "current", "full" };
 typedef enum { LOOP_TRUE,
                LOOP_FALSE,
                LOOP_PALINDROME } qtl_loop_t;
-char* ppsz_loop[] = { "true", "false", "palindrome" };
+const char* ppsz_loop[] = { "true", "false", "palindrome" };
 
 /*****************************************************************************
  * Local prototypes
@@ -139,8 +136,7 @@ static int Demux( demux_t *p_demux )
     INIT_PLAYLIST_STUFF;
 
     p_sys->p_playlist = p_playlist;
-    p_sys->p_current = p_current;
-    p_sys->p_item_in_category = p_item_in_category;
+    p_sys->p_current_input = p_current_input;
 
     p_xml = p_sys->p_xml = xml_Create( p_demux );
     if( !p_xml ) return -1;
@@ -162,7 +158,7 @@ static int Demux( demux_t *p_demux )
     {
         msg_Err( p_demux, "invalid root node %i, %s",
                  xml_ReaderNodeType( p_xml_reader ), psz_eltname );
-        FREE( psz_eltname );
+        free( psz_eltname );
 
         /* second line has <?quicktime tag ... so we try to skip it */
         msg_Dbg( p_demux, "trying to read one more node" );
@@ -173,11 +169,11 @@ static int Demux( demux_t *p_demux )
         {
             msg_Err( p_demux, "invalid root node %i, %s",
                      xml_ReaderNodeType( p_xml_reader ), psz_eltname );
-            FREE( psz_eltname );
+            free( psz_eltname );
             return -1;
         }
     }
-    FREE( psz_eltname );
+    free( psz_eltname );
 
     while( xml_ReaderNextAttr( p_sys->p_xml_reader ) == VLC_SUCCESS )
     {
@@ -186,8 +182,8 @@ static int Demux( demux_t *p_demux )
 
         if( !psz_attrname || !psz_attrvalue )
         {
-            FREE( psz_attrname );
-            FREE( psz_attrvalue );
+            free( psz_attrname );
+            free( psz_attrvalue );
             return -1;
         }
 
@@ -322,8 +318,8 @@ static int Demux( demux_t *p_demux )
             msg_Dbg( p_demux, "Attribute %s with value %s isn't valid",
                      psz_attrname, psz_attrvalue );
         }
-        FREE( psz_attrname );
-        FREE( psz_attrvalue );
+        free( psz_attrname );
+        free( psz_attrvalue );
     }
 
     msg_Dbg( p_demux, "autoplay: %s (unused by VLC)",
@@ -360,16 +356,12 @@ static int Demux( demux_t *p_demux )
                     p_input, "QuickTime Media Link", _(type), "%s", field ) ; }
         SADD_INFO( "href", psz_href );
         SADD_INFO( "mime type", psz_mimetype );
-        playlist_BothAddInput( p_sys->p_playlist, p_input,
-                               p_sys->p_item_in_category, PLAYLIST_APPEND,
-                               PLAYLIST_END );
+        input_ItemAddSubItem( p_current_input, p_input );
         if( psz_qtnext )
         {
             p_input = input_ItemNewExt( p_sys->p_playlist,
                                         psz_qtnext, NULL, 0, NULL, -1 );
-            playlist_BothAddInput( p_sys->p_playlist, p_input,
-                                   p_sys->p_item_in_category,
-                                   PLAYLIST_APPEND, PLAYLIST_END );
+            input_ItemAddSubItem( p_current_input, p_input );
         }
     }
 
@@ -377,11 +369,11 @@ static int Demux( demux_t *p_demux )
 
     p_sys->p_playlist = NULL;
 
-    FREE( psz_href );
-    FREE( psz_moviename );
-    FREE( psz_qtnext );
-    FREE( psz_src );
-    FREE( psz_mimetype );
+    free( psz_href );
+    free( psz_moviename );
+    free( psz_qtnext );
+    free( psz_src );
+    free( psz_mimetype );
 
     return -1; /* Needed for correct operation of go back */
 }