X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Frtsp%2Frtsp.c;h=9587cea4c5e035e363fdf858f6a191c109105076;hb=78d87996ccb92d1dc91c9987685f976ed3be08a6;hp=57d04cc5f33948b01318ff58f4bbc0f01be520db;hpb=74cbdba8dc2482bf88cba3326a8ddb47cee532ee;p=vlc diff --git a/modules/access/rtsp/rtsp.c b/modules/access/rtsp/rtsp.c index 57d04cc5f3..9587cea4c5 100644 --- a/modules/access/rtsp/rtsp.c +++ b/modules/access/rtsp/rtsp.c @@ -23,10 +23,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #include "rtsp.h" @@ -238,7 +240,7 @@ static int rtsp_get_answers( rtsp_client_t *rtsp ) { char *buf = malloc( strlen(answer) ); sscanf( answer, "%*s %s", buf ); - if( rtsp->p_private->server ) free( rtsp->p_private->server ); + free( rtsp->p_private->server ); rtsp->p_private->server = buf; } if( !strncasecmp( answer, "Session:", 8 ) ) @@ -249,7 +251,7 @@ static int rtsp_get_answers( rtsp_client_t *rtsp ) { if( strcmp( buf, rtsp->p_private->session ) ) { - //fprintf( stderr, + //fprintf( stderr, // "rtsp: warning: setting NEW session: %s\n", buf ); free( rtsp->p_private->session ); rtsp->p_private->session = strdup( buf ); @@ -493,7 +495,7 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl, colon = strchr( mrl_ptr, ':' ); if( !slash ) slash = mrl_ptr + strlen(mrl_ptr) + 1; - if( !colon ) colon = slash; + if( !colon ) colon = slash; if( colon > slash ) colon = slash; pathbegin = slash - mrl_ptr; @@ -546,7 +548,7 @@ int rtsp_connect( rtsp_client_t *rtsp, const char *psz_mrl, } /* - * closes an rtsp connection + * closes an rtsp connection */ void rtsp_close( rtsp_client_t *rtsp ) @@ -557,12 +559,12 @@ void rtsp_close( rtsp_client_t *rtsp ) rtsp->pf_disconnect( rtsp->p_userdata ); } - if( rtsp->p_private->path ) free( rtsp->p_private->path ); - if( rtsp->p_private->host ) free( rtsp->p_private->host ); - if( rtsp->p_private->mrl ) free( rtsp->p_private->mrl ); - if( rtsp->p_private->session ) free( rtsp->p_private->session ); - if( rtsp->p_private->user_agent ) free( rtsp->p_private->user_agent ); - if( rtsp->p_private->server ) free( rtsp->p_private->server ); + free( rtsp->p_private->path ); + free( rtsp->p_private->host ); + free( rtsp->p_private->mrl ); + free( rtsp->p_private->session ); + free( rtsp->p_private->user_agent ); + free( rtsp->p_private->server ); rtsp_free_answers( rtsp ); rtsp_unschedule_all( rtsp ); free( rtsp->p_private ); @@ -602,7 +604,7 @@ char *rtsp_search_answers( rtsp_client_t *rtsp, const char *tag ) void rtsp_set_session( rtsp_client_t *rtsp, const char *id ) { - if( rtsp->p_private->session ) free( rtsp->p_private->session ); + free( rtsp->p_private->session ); rtsp->p_private->session = strdup(id); } @@ -632,7 +634,7 @@ void rtsp_schedule_field( rtsp_client_t *rtsp, const char *string ) } /* - * removes the first scheduled field which prefix matches string. + * removes the first scheduled field which prefix matches string. */ void rtsp_unschedule_field( rtsp_client_t *rtsp, const char *string ) @@ -645,7 +647,7 @@ void rtsp_unschedule_field( rtsp_client_t *rtsp, const char *string ) { if( !strncmp(*ptr, string, strlen(string)) ) break; } - if( *ptr ) free( *ptr ); + free( *ptr ); ptr++; do {