]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/sgimb.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / demux / playlist / sgimb.c
index 7d2d8146542569ea8b53fd26f9d70a3ccb070005..50f654062e13c671101199a419c29219021a1567 100644 (file)
@@ -81,7 +81,7 @@
  * AutoStart=True
  *     Start playing automatically
  * DeliveryService=cds
- *     Simulcasted (scheduled unicast) content. (Green dot in Kasenna web interface) 
+ *     Simulcasted (scheduled unicast) content. (Green dot in Kasenna web interface)
  * sgiShowingName=A nice name that everyone likes
  *     A human readible descriptive title for this stream.
  * sgiSid=2311
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>                                      /* malloc(), free() */
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_demux.h>
 #include "playlist.h"
 
 /*****************************************************************************
@@ -135,7 +134,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args );
 int E_(Import_SGIMB)( vlc_object_t * p_this )
 {
     demux_t *p_demux = (demux_t *)p_this;
-    demux_sys_t *p_sys;
     byte_t *p_peek;
     int i_size;
 
@@ -152,27 +150,22 @@ int E_(Import_SGIMB)( vlc_object_t * p_this )
         }
         if ( !strncasecmp( (char *)p_peek, "sgiNameServerHost=", i_len ) )
         {
-            p_demux->pf_demux = Demux;
-            p_demux->pf_control = Control;
-
-            p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
-            p_sys->psz_uri = NULL;
-            p_sys->psz_server = NULL;
-            p_sys->psz_location = NULL;
-            p_sys->psz_name = NULL;
-            p_sys->psz_user = NULL;
-            p_sys->psz_password = NULL;
-            p_sys->psz_mcast_ip = NULL;
-            p_sys->i_mcast_port = 0;
-            p_sys->i_packet_size = 0;
-            p_sys->i_duration = 0;
-            p_sys->i_port = 0;
-            p_sys->i_sid = 0;
-            p_sys->b_rtsp_kasenna = VLC_FALSE;
-            p_sys->b_concert = VLC_FALSE;
-            
-            msg_Dbg( p_demux, "using sgimb playlist import");
-
+            STANDARD_DEMUX_INIT_MSG( "using SGIMB playlist reader" );
+            p_demux->p_sys->psz_uri = NULL;
+            p_demux->p_sys->psz_server = NULL;
+            p_demux->p_sys->psz_location = NULL;
+            p_demux->p_sys->psz_name = NULL;
+            p_demux->p_sys->psz_user = NULL;
+            p_demux->p_sys->psz_password = NULL;
+            p_demux->p_sys->psz_mcast_ip = NULL;
+            p_demux->p_sys->i_mcast_port = 0;
+            p_demux->p_sys->i_packet_size = 0;
+            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;
             return VLC_SUCCESS;
         }
     }
@@ -380,42 +373,40 @@ static int Demux ( demux_t *p_demux )
     p_child = input_ItemNewWithType( (vlc_object_t *)p_playlist, 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 );
-    
     if( !p_child )
     {
         msg_Err( p_demux, "A valid playlistitem could not be created" );
         return VLC_EGENERIC;
     }
 
-    vlc_input_item_CopyOptions( p_current->p_input, p_child );
+    input_ItemCopyOptions( p_current_input, p_child );
     if( p_sys->i_packet_size && p_sys->psz_mcast_ip )
     {
         char *psz_option;
         p_sys->i_packet_size += 1000;
         asprintf( &psz_option, "mtu=%i", p_sys->i_packet_size );
-        vlc_input_item_AddOption( p_child, psz_option );
+        input_ItemAddOption( p_child, psz_option );
         free( psz_option );
     }
     if( !p_sys->psz_mcast_ip )
     {
         char *psz_option;
         asprintf( &psz_option, "rtsp-caching=5000" );
-        vlc_input_item_AddOption( p_child, psz_option );
+        input_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" );
-        vlc_input_item_AddOption( p_child, psz_option );
+        input_ItemAddOption( p_child, psz_option );
         free( psz_option );
     }
 
-    playlist_AddWhereverNeeded( p_playlist, p_child, p_current,
-                                 p_item_in_category, (i_parent_id > 0 )? VLC_TRUE : VLC_FALSE,
-                                 PLAYLIST_APPEND );
+    input_ItemAddSubItem( p_current_input, p_child );
     HANDLE_PLAY_AND_RELEASE
-    return VLC_SUCCESS;
+    return -1; /* Needed for correct operation of go back */
 }
 
 static int Control( demux_t *p_demux, int i_query, va_list args )