]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/qtl.c
demux/playlist/ : removes useless unused parameter warnings
[vlc] / modules / demux / playlist / qtl.c
index eabd67464b20a1a9b179ad1814eef7d246294695..7c49b77e55935572d50f7610c65424ffc1e62c89 100644 (file)
@@ -47,11 +47,13 @@ volume - 0 (mute) - 100 (max)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <ctype.h>                                              /* isspace() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/intf.h>
+#include <vlc_demux.h>
 
 #include "playlist.h"
 #include "vlc_xml.h"
@@ -59,9 +61,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;
-    int i_parent_id;
+    input_item_t *p_current_input;
 
     xml_t *p_xml;
     xml_reader_t *p_xml_reader;
@@ -72,11 +72,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
@@ -119,6 +119,7 @@ static int Demux( demux_t *p_demux )
     xml_t *p_xml;
     xml_reader_t *p_xml_reader;
     char *psz_eltname = NULL;
+    input_item_t *p_input;
 
     /* List of all possible attributes. The only required one is "src" */
     vlc_bool_t b_autoplay = VLC_FALSE;
@@ -139,9 +140,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->i_parent_id = i_parent_id;
-    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;
@@ -163,7 +162,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" );
@@ -174,11 +173,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 )
     {
@@ -187,8 +186,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;
         }
 
@@ -323,8 +322,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)",
@@ -361,19 +360,14 @@ 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_AddWhereverNeeded( p_sys->p_playlist, p_input,
-                            p_sys->p_current, p_sys->p_item_in_category,
-                            (p_sys->i_parent_id > 0 ) ? VLC_TRUE: VLC_FALSE,
-                            PLAYLIST_APPEND );
-
+        input_ItemAddSubItem( p_current_input, p_input );
+        vlc_gc_decref( p_input );
         if( psz_qtnext )
         {
             p_input = input_ItemNewExt( p_sys->p_playlist,
                                         psz_qtnext, NULL, 0, NULL, -1 );
-            playlist_AddWhereverNeeded( p_sys->p_playlist, p_input,
-                            p_sys->p_current, p_sys->p_item_in_category,
-                            (p_sys->i_parent_id > 0 ) ? VLC_TRUE: VLC_FALSE,
-                            PLAYLIST_APPEND );
+            input_ItemAddSubItem( p_current_input, p_input );
+            vlc_gc_decref( p_input );
         }
     }
 
@@ -381,16 +375,17 @@ 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 VLC_SUCCESS;
+    return 0; /* Needed for correct operation of go back */
 }
 
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
+    VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args);
     return VLC_EGENERIC;
 }