]> git.sesse.net Git - vlc/blobdiff - src/stream_output/sap.c
All signedness fixes
[vlc] / src / stream_output / sap.c
index 55bbf3dc4357db31ae2667cf43465dacd85b03ab..279821fbaca3c3243e601d514177ac93e1ece136 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * sap.c : SAP announce handler
  *****************************************************************************
- * Copyright (C) 2002-2005 VideoLAN
+ * Copyright (C) 2002-2005 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
@@ -387,12 +387,16 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
         p_address->i_wfd = net_OpenUDP( p_sap, "", 0,
                                         p_address->psz_address,
                                         p_address->i_port );
+        if( p_address->i_wfd != -1 )
+            net_StopRecv( p_address->i_wfd );
 
         if( p_sap->b_control == VLC_TRUE )
         {
             p_address->i_rfd = net_OpenUDP( p_sap, p_method->psz_address,
                                             p_address->i_port,
                                             "", 0 );
+            if( p_address->i_rfd != -1 )
+                net_StopSend( p_address->i_rfd );
             p_address->i_buff = 0;
             p_address->b_enabled = VLC_TRUE;
             p_address->b_ready = VLC_FALSE;
@@ -479,8 +483,8 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
     psz_head[ i_header_size-1 ] = '\0';
     p_sap_session->i_length = i_header_size + strlen( p_sap_session->psz_sdp);
 
-    p_sap_session->psz_data = (char *)malloc( sizeof(char)*
-                                              p_sap_session->i_length );
+    p_sap_session->psz_data = (uint8_t *)malloc( sizeof(char)*
+                                                 p_sap_session->i_length );
 
     /* Build the final message */
     memcpy( p_sap_session->psz_data, psz_head, i_header_size );
@@ -661,7 +665,7 @@ static int SDPGenerate( sap_handler_t *p_sap, session_descriptor_t *p_session )
 static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address )
 {
     int i_read;
-    char buffer[SAP_MAX_BUFFER];
+    uint8_t buffer[SAP_MAX_BUFFER];
     int i_tot = 0;
     mtime_t i_temp;
     int i_rate;