]> git.sesse.net Git - vlc/blobdiff - modules/demux/sgimb.c
* Change only the frontmost window opaqueness
[vlc] / modules / demux / sgimb.c
index 263a36303abbbd299d4edf9f5d59e575196a2253..3d6274581b68a62b9e7ef64497a2de41eb055787 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * sgimb.c: a meta demux to parse sgimb referrer files
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 the VideoLAN team
  * $Id$
  *
  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
@@ -111,6 +111,8 @@ static void Deactivate( vlc_object_t * );
 
 vlc_module_begin();
     set_description( _("Kasenna MediaBase metademux") );
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_DEMUX );
     set_capability( "demux2", 170 );
     set_callbacks( Activate, Deactivate );
     add_shortcut( "sgimb" );
@@ -279,7 +281,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     else if( !strncasecmp( psz_bol, "sgiFormatName=", sizeof("sgiFormatName=") - 1 ) )
     {
         psz_bol += sizeof("sgiFormatName=") - 1;
-        if( !strcasestr( psz_bol, "MPEG-4") ) /*not mpeg4 */
+        if( strcasestr( psz_bol, "MPEG-4") == NULL ) /*not mpeg4 found in string */
             p_sys->b_rtsp_kasenna = VLC_TRUE;
     }
     else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) )
@@ -334,9 +336,9 @@ static int Demux ( demux_t *p_demux )
     demux_sys_t     *p_sys = p_demux->p_sys;
     playlist_t      *p_playlist;
     playlist_item_t *p_item;
+    playlist_item_t *p_child;
     
     char            *psz_line;
-    int             i_position;
 
     p_playlist = (playlist_t *) vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST,
                                                  FIND_ANYWHERE );
@@ -346,8 +348,9 @@ static int Demux ( demux_t *p_demux )
         return -1;
     }
 
-    p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE;
-    i_position = p_playlist->i_index + 1;
+    p_item = playlist_LockItemGetByInput( p_playlist,
+                        ((input_thread_t *)p_demux->p_parent)->input.p_item );
+    playlist_ItemToNode( p_playlist, p_item );
 
     while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
     {
@@ -401,10 +404,10 @@ static int Demux ( demux_t *p_demux )
         free( temp );
     }
 
-    p_item = playlist_ItemNew( p_playlist, p_sys->psz_uri,
+    p_child = playlist_ItemNew( p_playlist, p_sys->psz_uri,
                       p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri );
 
-    if( !p_item || !p_item->input.psz_uri )
+    if( !p_child || !p_child->input.psz_uri )
     {
         msg_Err( p_demux, "A valid playlistitem could not be created" );
         return VLC_EGENERIC;
@@ -415,26 +418,30 @@ static int Demux ( demux_t *p_demux )
         char *psz_option;
         p_sys->i_packet_size += 1000;
         asprintf( &psz_option, "mtu=%i", p_sys->i_packet_size );
-        playlist_ItemAddOption( p_item, psz_option );
+        playlist_ItemAddOption( p_child, psz_option );
         free( psz_option );
     }
     if( !p_sys->psz_mcast_ip )
     {
         char *psz_option;
        asprintf( &psz_option, "rtsp-caching=5000" );
-       playlist_ItemAddOption( p_item, psz_option );
+       playlist_ItemAddOption( p_child, psz_option );
        free( psz_option );
     }
     if( !p_sys->psz_mcast_ip && p_sys->b_rtsp_kasenna )
     {
         char *psz_option;
         asprintf( &psz_option, "rtsp-kasenna" );
-        playlist_ItemAddOption( p_item, psz_option );
+        playlist_ItemAddOption( p_child, psz_option );
         free( psz_option );
     }
 
-    playlist_ItemSetDuration( p_item, p_sys->i_duration );
-    playlist_AddItem( p_playlist, p_item, PLAYLIST_INSERT, i_position );
+    playlist_ItemSetDuration( p_child, p_sys->i_duration );
+    playlist_NodeAddItem( p_playlist, p_child, p_item->pp_parents[0]->i_view, p_item, PLAYLIST_APPEND, PLAYLIST_END );
+    playlist_CopyParents( p_item, p_child );
+    playlist_Control( p_playlist, PLAYLIST_VIEWPLAY,
+                           p_playlist->status.i_view,
+                           p_playlist->status.p_item, NULL );
 
     vlc_object_release( p_playlist );
     return VLC_SUCCESS;