]> git.sesse.net Git - vlc/commitdiff
input: Preparse: fetch sub items if item is a playlist
authorThomas Guillem <thomas@gllm.fr>
Tue, 20 Jan 2015 09:46:28 +0000 (10:46 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 20 Jan 2015 10:20:27 +0000 (11:20 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
src/input/input.c

index 48e085da4987992accf7fd1d222a8175d5c356e4..4e9fb491fd3b87c67c10e21abf739436788f2b68 100644 (file)
@@ -192,8 +192,19 @@ int input_Preparse( vlc_object_t *p_parent, input_item_t *p_item )
     if( !p_input )
         return VLC_EGENERIC;
 
-    if( !Init( p_input ) )
+    if( !Init( p_input ) ) {
+        /* if the demux is a playlist, call Mainloop that will call
+         * demux_Demux in order to fetch sub items */
+        bool b_is_playlist = false;
+
+        if ( demux_Control( p_input->p->input.p_demux,
+                            DEMUX_IS_PLAYLIST,
+                            &b_is_playlist ) )
+            b_is_playlist = false;
+        if( b_is_playlist )
+            MainLoop( p_input, false );
         End( p_input );
+    }
 
     vlc_object_release( p_input );