]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/zpl.c
Update LIST file.
[vlc] / modules / demux / playlist / zpl.c
index 6c843a7fca4f89bbcc811dc88e013ab70de4024f..cb41810a06e23b12a3bd1bfac50e3d33562a3d40 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <vlc_common.h>
 #include <vlc_demux.h>
-#include <vlc_charset.h>
 
 #include "playlist.h"
 
@@ -74,18 +73,6 @@ void Close_ZPL( vlc_object_t *p_this )
     free( p_demux->p_sys );
 }
 
-static inline void MaybeFromLocaleRep (char **str)
-{
-    char *const orig_str = *str;
-
-    if ((orig_str != NULL) && !IsUTF8 (orig_str))
-    {
-        *str = FromLocaleDup (orig_str);
-        free (orig_str);
-    }
-}
-
-
 static int Demux( demux_t *p_demux )
 {
     char       *psz_line;
@@ -115,6 +102,8 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
+
     /* Loop on all lines */
     while( psz_line )
     {
@@ -132,8 +121,6 @@ static int Demux( demux_t *p_demux )
             if( !EMPTY_STR(psz_tabvalue) )
             {
                 psz_mrl = ProcessMRL( psz_tabvalue, p_demux->p_sys->psz_prefix );
-                if( psz_mrl )
-                    MaybeFromLocaleRep( &psz_mrl );
             }
             free( psz_tabvalue );
         }
@@ -180,7 +167,7 @@ static int Demux( demux_t *p_demux )
             /* create the input item */
             input_item_t *p_input = input_item_NewExt( p_demux, psz_mrl,
                                         psz_title, 0, NULL, 0, i_duration );
-            input_item_AddSubItem( p_current_input, p_input );
+            input_item_node_AppendItem( p_subitems, p_input );
             FREENULL( psz_mrl );
             FREENULL( psz_title );
             i_duration = -1;
@@ -203,6 +190,7 @@ static int Demux( demux_t *p_demux )
             SET( psz_copyright, Copyright );
 #undef SET
 
+            vlc_gc_decref( p_input );
         }
         else
             msg_Warn( p_demux, "invalid line '%s'", psz_parse );
@@ -212,6 +200,8 @@ static int Demux( demux_t *p_demux )
         psz_line = stream_ReadLine( p_demux->s );
     }
 
+    input_item_node_PostAndDelete( p_subitems );
+
     vlc_gc_decref(p_current_input);
     var_Destroy( p_demux, "zpl-extvlcopt" );
     return 0; /* Needed for correct operation of go back */