]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/sgimb.c
input: replace ITEM_TYPE_NET by ITEM_TYPE_STREAM
[vlc] / modules / demux / playlist / sgimb.c
index 9a4ddfd56b689d6246e45fed480fedb0d69435bf..fd2e06430aa6baf58654fb22e154a7d618d78a0e 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * sgimb.c: a meta demux to parse sgimb referrer files
  *****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Derk-Jan Hartman <hartman at videolan dot org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -130,7 +130,6 @@ struct demux_sys_t
 };
 
 static int Demux ( demux_t *p_demux );
-static int Control( demux_t *p_demux, int i_query, va_list args );
 
 /*****************************************************************************
  * Activate: initializes m3u demux structures
@@ -169,7 +168,7 @@ int Import_SGIMB( vlc_object_t * p_this )
             p_demux->p_sys->i_sid = 0;
             p_demux->p_sys->b_rtsp_kasenna = false;
             p_demux->p_sys->b_concert = false;
+
             return VLC_SUCCESS;
         }
     }
@@ -217,8 +216,6 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     else if( !strncasecmp( psz_bol, "Stream=\"", sizeof("Stream=\"") - 1 ) )
     {
         psz_bol += sizeof("Stream=\"") - 1;
-        if ( !psz_bol )
-            return 0;
         char* psz_tmp = strrchr( psz_bol, '"' );
         if( !psz_tmp )
             return 0;
@@ -367,19 +364,18 @@ static int Demux ( demux_t *p_demux )
             return -1;
         }
 
-        free( p_sys->psz_uri );
-        if( asprintf( &p_sys->psz_uri, "%s%%3FMeDiAbAsEshowingId=%d%%26MeDiAbAsEconcert%%3FMeDiAbAsE",
-                p_sys->psz_uri, p_sys->i_sid ) == -1 )
-        {
-            p_sys->psz_uri = NULL;
+        char *uri;
+        if( asprintf( &uri, "%s%%3FMeDiAbAsEshowingId=%d%%26MeDiAbAsEconcert"
+                      "%%3FMeDiAbAsE", p_sys->psz_uri, p_sys->i_sid ) == -1 )
             return -1;
-        }
+        free( p_sys->psz_uri );
+        p_sys->psz_uri = uri;
     }
 
-    p_child = input_item_NewWithType( VLC_OBJECT(p_demux), p_sys->psz_uri,
+    p_child = input_item_NewWithType( p_sys->psz_uri,
                       p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
-                      0, NULL, 0, p_sys->i_duration, ITEM_TYPE_NET );
+                      0, NULL, 0, p_sys->i_duration, ITEM_TYPE_STREAM );
+
     if( !p_child )
     {
         msg_Err( p_demux, "A valid playlistitem could not be created" );
@@ -402,16 +398,8 @@ static int Demux ( demux_t *p_demux )
     if( !p_sys->psz_mcast_ip && p_sys->b_rtsp_kasenna )
         input_item_AddOption( p_child, "rtsp-kasenna", VLC_INPUT_OPTION_TRUSTED );
 
-    input_item_AddSubItem( p_current_input, p_child );
-    input_item_AddSubItem2( p_current_input, p_child );
+    input_item_PostSubItem( p_current_input, p_child );
     vlc_gc_decref( p_child );
     vlc_gc_decref(p_current_input);
     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;
-}
-