Changeset 08b246eacb1858c1b7d50aadeebd61ea7e6fc231

Show
Ignore:
Timestamp:
12/06/03 13:37:48 (5 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1055417868 +0000
git-parent:

[9628e431c59cce1744dc47950dc0d7b11edab6fb]

git-author:
Clément Stenac <zorglub@videolan.org> 1055417868 +0000
Message:

Code cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/announce.h

    r2db764f r08b246e  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: announce.h,v 1.2 2003/05/26 13:45:51 zorglub Exp $ 
     5 * $Id: announce.h,v 1.3 2003/06/12 11:37:48 zorglub Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    6666VLC_EXPORT( sap_session_t *,            sout_SAPNew,         ( sout_instance_t *,char * , char * , char * ) ); 
    6767VLC_EXPORT( void,            sout_SAPSend,        ( sout_instance_t *,sap_session_t * ) ); 
    68 VLC_EXPORT( void,            sout_SAPDelete,      ( sap_session_t * ) ); 
     68VLC_EXPORT( void,            sout_SAPDelete,      ( sout_instance_t *,sap_session_t * ) ); 
  • modules/stream_out/standard.c

    r2db764f r08b246e  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: standard.c,v 1.3 2003/05/26 13:45:52 zorglub Exp $ 
     5 * $Id: standard.c,v 1.4 2003/06/12 11:37:48 zorglub Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    130130        msg_Dbg( p_sout , "Creating SAP" ); 
    131131        p_sap = sout_SAPNew( p_sout , psz_url , psz_port , psz_sap ); 
     132        if(!p_sap) 
     133        { 
     134                msg_Err( p_sout,"Unable to initialize SAP. SAP disabled"); 
     135                p_sys->b_sap=0; 
     136        } 
    132137    }    
    133138     
     
    159164 
    160165    if(p_sys -> b_sap) 
    161             sout_SAPDelete( p_sys->p_sap );  
     166          sout_SAPDelete( p_this ,p_sys->p_sap );  
    162167 
    163168    sout_MuxDelete( p_sys->p_mux ); 
  • src/stream_output/announce.c

    r19eb3d9 r08b246e  
    5252               
    5353        p_new = (sap_session_t *)malloc( sizeof ( sap_session_t ) ) ; 
     54 
     55        if ( !p_new ) 
     56                return NULL; 
    5457         
    5558        sprintf ( p_new->psz_url , "%s" , psz_url_arg ); 
     
    9295 * sout_SAPDelete: Deletes a SAP Session  
    9396 *****************************************************************************/ 
    94 void sout_SAPDelete( sap_session_t * p_this ) 
     97void sout_SAPDelete( sout_instance_t *p_sout , sap_session_t * p_this ) 
    9598{ 
    96         shutdown(p_this->socket,0); 
    97         free(p_this);         
     99        if( close(p_this->socket) ) 
     100                msg_Err ( p_sout, "Unable to close SAP socket"); 
     101        if( p_this ) free(p_this);         
    98102}        
    99103 
     
    113117      int i_size; 
    114118      
    115     if( p_this->sendnow == 1
     119    if( p_this->sendnow == 24
    116120    { 
    117          i_header_size = 9 + strlen( payload_type ); 
    118          sap_head = ( char * )malloc( i_header_size * sizeof( char ) ); 
    119                  
     121          i_header_size = 9 + strlen( payload_type ); 
     122          sap_head = ( char * )malloc( i_header_size * sizeof( char ) ); 
     123         
     124          if( ! sap_head )          
     125          { 
     126                  msg_Err( p_sout , "No memory left"); 
     127                  return; 
     128          }        
     129          
    120130          sap_head[0]=0x20; /* Means IPv4, not encrypted, not compressed */ 
    121131          sap_head[1]=0x00; /* No authentification */ 
     
    131141          sap_head[ i_header_size-1 ] = '\0';  
    132142        
    133         /* Do not add spaces at beginning of the lines ! */   
     143           /* Do not add spaces at beginning of the lines ! */   
    134144          sprintf(sap_msg,"v=0\n\ 
    135145o=VideoLAN 3247692199 3247895918 IN IP4 VideoLAN\n\ 
     
    145155      
    146156     sap_send = ( char* )malloc( i_size*sizeof(char) );  
    147            
     157         
     158      if(! sap_send) 
     159      { 
     160             msg_Err( p_sout ,  "No memory left") ; 
     161             return; 
     162      } 
     163       
    148164      for(i=0 ; i<i_header_size ; i++) 
    149165      {