]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/sgimb.c
sgimb: Don't use playlist code.
[vlc] / modules / demux / playlist / sgimb.c
index d574db93b35682baa6a68645241a676eb67ddd8d..6a8d4d677dffe2903ed975c24c1596dafec07321 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include <vlc_demux.h>
 #include "playlist.h"
 
@@ -121,8 +125,8 @@ struct demux_sys_t
     mtime_t     i_duration;     /* sgiDuration= */
     int         i_port;         /* sgiRtspPort= */
     int         i_sid;          /* sgiSid= */
-    vlc_bool_t  b_concert;      /* DeliveryService=cds */
-    vlc_bool_t  b_rtsp_kasenna; /* kasenna style RTSP */
+    bool  b_concert;      /* DeliveryService=cds */
+    bool  b_rtsp_kasenna; /* kasenna style RTSP */
 };
 
 static int Demux ( demux_t *p_demux );
@@ -131,10 +135,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 /*****************************************************************************
  * Activate: initializes m3u demux structures
  *****************************************************************************/
-int E_(Import_SGIMB)( vlc_object_t * p_this )
+int Import_SGIMB( vlc_object_t * p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    const byte_t *p_peek;
+    const uint8_t *p_peek;
     int i_size;
 
     /* Lets check the content to see if this is a sgi mediabase file */
@@ -163,8 +167,8 @@ int E_(Import_SGIMB)( vlc_object_t * p_this )
             p_demux->p_sys->i_duration = 0;
             p_demux->p_sys->i_port = 0;
             p_demux->p_sys->i_sid = 0;
-            p_demux->p_sys->b_rtsp_kasenna = VLC_FALSE;
-            p_demux->p_sys->b_concert = VLC_FALSE;
+            p_demux->p_sys->b_rtsp_kasenna = false;
+            p_demux->p_sys->b_concert = false;
  
             return VLC_SUCCESS;
         }
@@ -175,24 +179,17 @@ int E_(Import_SGIMB)( vlc_object_t * p_this )
 /*****************************************************************************
  * Deactivate: frees unused data
  *****************************************************************************/
-void E_(Close_SGIMB)( vlc_object_t *p_this )
+void Close_SGIMB( vlc_object_t *p_this )
 {
     demux_t *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys = p_demux->p_sys;
-    if( p_sys->psz_uri )
-        free( p_sys->psz_uri );
-    if( p_sys->psz_server )
-        free( p_sys->psz_server );
-    if( p_sys->psz_location )
-        free( p_sys->psz_location );
-    if( p_sys->psz_name )
-        free( p_sys->psz_name );
-    if( p_sys->psz_user )
-        free( p_sys->psz_user );
-    if( p_sys->psz_password )
-        free( p_sys->psz_password );
-    if( p_sys->psz_mcast_ip )
-        free( p_sys->psz_mcast_ip );
+    free( p_sys->psz_uri );
+    free( p_sys->psz_server );
+    free( p_sys->psz_location );
+    free( p_sys->psz_name );
+    free( p_sys->psz_user );
+    free( p_sys->psz_password );
+    free( p_sys->psz_mcast_ip );
     free( p_demux->p_sys );
     return;
 }
@@ -261,7 +258,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     {
         psz_bol += sizeof("sgiFormatName=") - 1;
         if( strcasestr( psz_bol, "MPEG-4") == NULL ) /*not mpeg4 found in string */
-            p_sys->b_rtsp_kasenna = VLC_TRUE;
+            p_sys->b_rtsp_kasenna = true;
     }
     else if( !strncasecmp( psz_bol, "sgiMulticastAddress=", sizeof("sgiMulticastAddress=") - 1 ) )
     {
@@ -295,7 +292,7 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
     }
     else if( !strncasecmp( psz_bol, "DeliveryService=cds", sizeof("DeliveryService=cds") - 1 ) )
     {
-        p_sys->b_concert = VLC_TRUE;
+        p_sys->b_concert = true;
     }
     else
     {
@@ -321,7 +318,7 @@ static int Demux ( demux_t *p_demux )
     while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
     {
         ParseLine( p_demux, psz_line );
-        if( psz_line ) free( psz_line );
+        free( psz_line );
     }
 
     if( p_sys->psz_mcast_ip )
@@ -331,7 +328,7 @@ static int Demux ( demux_t *p_demux )
         char *temp;
 
         asprintf( &temp, "udp://@" "%s:%i", p_sys->psz_mcast_ip, p_sys->i_mcast_port );
-        if( p_sys->psz_uri ) free( p_sys->psz_uri );
+        free( p_sys->psz_uri );
         p_sys->psz_uri = strdup( temp );
         free( temp );
     }
@@ -370,7 +367,7 @@ static int Demux ( demux_t *p_demux )
         free( temp );
     }
 
-    p_child = input_ItemNewWithType( (vlc_object_t *)p_playlist, p_sys->psz_uri,
+    p_child = input_ItemNewWithType( p_demux, p_sys->psz_uri,
                       p_sys->psz_name ? p_sys->psz_name : p_sys->psz_uri,
                       0, NULL, p_sys->i_duration, ITEM_TYPE_NET );
  
@@ -404,7 +401,7 @@ static int Demux ( demux_t *p_demux )
         free( psz_option );
     }
 
-    input_ItemAddSubItem( p_current_input, p_child, VLC_FALSE );
+    input_ItemAddSubItem( p_current_input, p_child );
     vlc_gc_decref( p_child );
     HANDLE_PLAY_AND_RELEASE
     return 0; /* Needed for correct operation of go back */
@@ -412,6 +409,7 @@ static int Demux ( demux_t *p_demux )
 
 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;
 }