]> git.sesse.net Git - vlc/blobdiff - src/stream_output/announce.c
Uniformize source files encoding
[vlc] / src / stream_output / announce.c
index 860fcf3cb68e6d017d0df1542671863bb92fe8b5..88de49f334697516be1532062b892fe27de1c459 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * announce.c : announce handler
  *****************************************************************************
- * Copyright (C) 2002-2004 VideoLAN
+ * Copyright (C) 2002-2004 the VideoLAN team
  * $Id$
  *
- * Authors: Clément Stenac <zorglub@videolan.org>
+ * Authors: Clément Stenac <zorglub@videolan.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
@@ -18,7 +18,7 @@
  *
  * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -83,11 +83,13 @@ int sout_AnnounceRegister( sout_instance_t *p_sout,
  *
  * \param p_sout a sout instance structure
  * \param psz_sdp the SDP to register
+ * \param psz_uri session URI (needed for SAP address auto detection
  * \param p_method an announce method descriptor
  * \return the new session descriptor structure
  */
 session_descriptor_t *sout_AnnounceRegisterSDP( sout_instance_t *p_sout,
-                          char *psz_sdp, announce_method_t *p_method )
+                          const char *psz_sdp, const char *psz_uri,
+                          announce_method_t *p_method )
 {
     session_descriptor_t *p_session;
     announce_handler_t *p_announce = (announce_handler_t*)
@@ -113,6 +115,7 @@ session_descriptor_t *sout_AnnounceRegisterSDP( sout_instance_t *p_sout,
 
     p_session = sout_AnnounceSessionCreate();
     p_session->psz_sdp = strdup( psz_sdp );
+    p_session->psz_uri = strdup( psz_uri );
     announce_Register( p_announce, p_session, p_method );
 
     vlc_object_release( p_announce );
@@ -191,7 +194,7 @@ void sout_AnnounceSessionDestroy( session_descriptor_t *p_session )
 /**
  * Create and initialize an announcement method structure
  *
- * \param i_type METHOD_TYPE_SAP or METHOD_TYPE_SLP
+ * \param i_type METHOD_TYPE_SAP
  * \return a new announce_method structure
  */
 announce_method_t * sout_AnnounceMethodCreate( int i_type )
@@ -199,14 +202,10 @@ announce_method_t * sout_AnnounceMethodCreate( int i_type )
     announce_method_t *p_method;
 
     p_method = (announce_method_t *)malloc( sizeof(announce_method_t) );
+    if( p_method == NULL )
+        return NULL;
 
-    if( p_method )
-    {
-        p_method->i_type = i_type;
-        if( i_type == METHOD_TYPE_SAP )
-            /* Default value */
-            p_method->psz_address = NULL;
-    }
+    p_method->i_type = i_type;
     return p_method;
 }
 
@@ -286,12 +285,7 @@ int announce_Register( announce_handler_t *p_announce,
         }
         /* this will set p_session->p_sap for later deletion */
         msg_Dbg( p_announce, "adding SAP session");
-        p_announce->p_sap->pf_add( p_announce->p_sap, p_session, p_method );
-    }
-    else if( p_method->i_type == METHOD_TYPE_SLP )
-    {
-        msg_Dbg( p_announce, "SLP unsupported at the moment" );
-        return VLC_EGENERIC;
+        p_announce->p_sap->pf_add( p_announce->p_sap, p_session );
     }
     else
     {