Changeset 08b246eacb1858c1b7d50aadeebd61ea7e6fc231
- 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
| r2db764f |
r08b246e |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Christophe Massiot <massiot@via.ecp.fr> |
|---|
| … | … | |
| 66 | 66 | VLC_EXPORT( sap_session_t *, sout_SAPNew, ( sout_instance_t *,char * , char * , char * ) ); |
|---|
| 67 | 67 | VLC_EXPORT( void, sout_SAPSend, ( sout_instance_t *,sap_session_t * ) ); |
|---|
| 68 | | VLC_EXPORT( void, sout_SAPDelete, ( sap_session_t * ) ); |
|---|
| | 68 | VLC_EXPORT( void, sout_SAPDelete, ( sout_instance_t *,sap_session_t * ) ); |
|---|
| r2db764f |
r08b246e |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * 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 $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Laurent Aimar <fenrir@via.ecp.fr> |
|---|
| … | … | |
| 130 | 130 | msg_Dbg( p_sout , "Creating SAP" ); |
|---|
| 131 | 131 | 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 | } |
|---|
| 132 | 137 | } |
|---|
| 133 | 138 | |
|---|
| … | … | |
| 159 | 164 | |
|---|
| 160 | 165 | if(p_sys -> b_sap) |
|---|
| 161 | | sout_SAPDelete( p_sys->p_sap ); |
|---|
| | 166 | sout_SAPDelete( p_this ,p_sys->p_sap ); |
|---|
| 162 | 167 | |
|---|
| 163 | 168 | sout_MuxDelete( p_sys->p_mux ); |
|---|
| r19eb3d9 |
r08b246e |
|
| 52 | 52 | |
|---|
| 53 | 53 | p_new = (sap_session_t *)malloc( sizeof ( sap_session_t ) ) ; |
|---|
| | 54 | |
|---|
| | 55 | if ( !p_new ) |
|---|
| | 56 | return NULL; |
|---|
| 54 | 57 | |
|---|
| 55 | 58 | sprintf ( p_new->psz_url , "%s" , psz_url_arg ); |
|---|
| … | … | |
| 92 | 95 | * sout_SAPDelete: Deletes a SAP Session |
|---|
| 93 | 96 | *****************************************************************************/ |
|---|
| 94 | | void sout_SAPDelete( sap_session_t * p_this ) |
|---|
| | 97 | void sout_SAPDelete( sout_instance_t *p_sout , sap_session_t * p_this ) |
|---|
| 95 | 98 | { |
|---|
| 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); |
|---|
| 98 | 102 | } |
|---|
| 99 | 103 | |
|---|
| … | … | |
| 113 | 117 | int i_size; |
|---|
| 114 | 118 | |
|---|
| 115 | | if( p_this->sendnow == 1 ) |
|---|
| | 119 | if( p_this->sendnow == 24 ) |
|---|
| 116 | 120 | { |
|---|
| 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 | |
|---|
| 120 | 130 | sap_head[0]=0x20; /* Means IPv4, not encrypted, not compressed */ |
|---|
| 121 | 131 | sap_head[1]=0x00; /* No authentification */ |
|---|
| … | … | |
| 131 | 141 | sap_head[ i_header_size-1 ] = '\0'; |
|---|
| 132 | 142 | |
|---|
| 133 | | /* Do not add spaces at beginning of the lines ! */ |
|---|
| | 143 | /* Do not add spaces at beginning of the lines ! */ |
|---|
| 134 | 144 | sprintf(sap_msg,"v=0\n\ |
|---|
| 135 | 145 | o=VideoLAN 3247692199 3247895918 IN IP4 VideoLAN\n\ |
|---|
| … | … | |
| 145 | 155 | |
|---|
| 146 | 156 | 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 | |
|---|
| 148 | 164 | for(i=0 ; i<i_header_size ; i++) |
|---|
| 149 | 165 | { |
|---|