]> git.sesse.net Git - vlc/commitdiff
Fix DVB demuxer. Barely tested
authorClément Stenac <zorglub@videolan.org>
Thu, 25 May 2006 10:11:06 +0000 (10:11 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 25 May 2006 10:11:06 +0000 (10:11 +0000)
modules/demux/playlist/b4s.c
modules/demux/playlist/dvb.c
modules/demux/playlist/m3u.c
modules/demux/playlist/playlist.h
modules/demux/playlist/podcast.c

index 082ed74f2fbe9d6155c210910daa4e233cf5d191..30fc35bf3db324abb490d04a60e0faf37e6ac98a 100644 (file)
@@ -105,7 +105,7 @@ void E_(Close_B4S)( vlc_object_t *p_this )
 static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    int i_ret, i_parent_id;
+    int i_ret;
 
     xml_t *p_xml;
     xml_reader_t *p_xml_reader;
index dc6ee78ae936da26e709697031a6df364455cc7b..0be77b3016d86e97a99dea9cb693df5664da3428 100644 (file)
@@ -100,24 +100,8 @@ void E_(Close_DVB)( vlc_object_t *p_this )
  *****************************************************************************/
 static int Demux( demux_t *p_demux )
 {
-#if 0
-    playlist_t *p_playlist;
     char       *psz_line;
-    playlist_item_t *p_current;
-    vlc_bool_t b_play;
-
-    p_playlist = (playlist_t *) vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST,
-                                                 FIND_ANYWHERE );
-    if( !p_playlist )
-    {
-        msg_Err( p_demux, "can't find playlist" );
-        return -1;
-    }
-
-    b_play = E_(FindItem)( p_demux, p_playlist, &p_current );
-
-    playlist_ItemToNode( p_playlist, p_current );
-    p_current->p_input->i_type = ITEM_TYPE_PLAYLIST;
+    INIT_PLAYLIST_STUFF;
 
     while( (psz_line = stream_ReadLine( p_demux->s )) )
     {
@@ -134,20 +118,16 @@ static int Demux( demux_t *p_demux )
 
         EnsureUTF8( psz_name );
 
-        p_item = playlist_ItemNew( p_playlist, "dvb:", psz_name );
+        p_input = input_ItemNewExt( p_playlist, "dvb:", psz_name, 0, NULL, -1 );
         for( i = 0; i< i_options; i++ )
         {
             EnsureUTF8( ppsz_options[i] );
-            playlist_ItemAddOption( p_item, ppsz_options[i] );
+            vlc_input_item_AddOption( p_input, ppsz_options[i] );
         }
-        playlist_NodeAddItem( p_playlist, p_item,
-                              p_current->pp_parents[0]->i_view,
-                              p_current, PLAYLIST_APPEND, PLAYLIST_END );
-
-        /* We need to declare the parents of the node as the
-         *                  * same of the parent's ones */
-        playlist_CopyParents( p_current, p_item );
-        vlc_input_item_CopyOptions( &p_current->input, &p_item->input );
+        playlist_AddWhereverNeeded( p_playlist, p_input, p_current, 
+                                    p_item_in_category,
+                                    (i_parent_id > 0 ) ? VLC_TRUE: VLC_FALSE,
+                                    PLAYLIST_APPEND );
 
         while( i_options-- ) free( ppsz_options[i_options] );
         if( ppsz_options ) free( ppsz_options );
@@ -155,20 +135,8 @@ static int Demux( demux_t *p_demux )
         free( psz_line );
     }
 
-    /* Go back and play the playlist */
-    if( b_play && p_playlist->status.p_item &&
-        p_playlist->status.p_item->i_children > 0 )
-    {
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
-                          p_playlist->status.i_view,
-                          p_playlist->status.p_item,
-                          p_playlist->status.p_item->pp_children[0] );
-    }
-
-    vlc_object_release( p_playlist );
+    HANDLE_PLAY_AND_RELEASE;
     return VLC_SUCCESS;
-#endif
-    return 0;
 }
 
 static struct
index 931ad9b062c0bf8fc0891dadef6c16f7c3b6f7f5..3f021449a00ffc51d8d00da3050fb31ada72e0cd 100644 (file)
@@ -113,7 +113,7 @@ static int Demux( demux_t *p_demux )
     int        i_parsed_duration = 0;
     mtime_t    i_duration = -1;
     const char**ppsz_options = NULL;
-    int        i_options = 0, i, i_parent_id;
+    int        i_options = 0, i;
     vlc_bool_t b_cleanup = VLC_FALSE;
 
     INIT_PLAYLIST_STUFF;
index a669849e6df83823d90e9dfd1a05704d7e47b6d2..3103ae8d71965ef4cef43acbefe7c64bd2e64922 100644 (file)
@@ -54,6 +54,7 @@ int E_(Import_Shoutcast) ( vlc_object_t * );
 void E_(Close_Shoutcast) ( vlc_object_t * );
 
 #define INIT_PLAYLIST_STUFF \
+    int i_parent_id; \
     vlc_bool_t b_play; \
     playlist_item_t *p_current, *p_item_in_category = NULL; \
     input_item_t *p_input; \
index 25f9846eb835b7fc5bfb327040a3fbb13154139d..f8ed6f74e01ed305bce824ffabd68a6e7be90b65 100644 (file)
@@ -109,7 +109,7 @@ static int Demux( demux_t *p_demux )
 
     vlc_bool_t b_item = VLC_FALSE;
     vlc_bool_t b_image = VLC_FALSE;
-    int i_ret, i_parent_id;
+    int i_ret;
 
     xml_t *p_xml;
     xml_reader_t *p_xml_reader;