* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include "rtsp.h"
if( i_code != 200 )
{
- fprintf( stderr, "librtsp: server responds: '%s'\n", psz_string );
+ //fprintf( stderr, "librtsp: server responds: '%s'\n", psz_string );
}
return i_code;
{
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 ) )
{
if( strcmp( buf, rtsp->p_private->session ) )
{
- fprintf( stderr,
- "rtsp: warning: setting NEW session: %s\n", buf );
+ //fprintf( stderr,
+ // "rtsp: warning: setting NEW session: %s\n", buf );
free( rtsp->p_private->session );
rtsp->p_private->session = strdup( buf );
}
}
else
{
- fprintf( stderr, "setting session id to: %s\n", buf );
+ //fprintf( stderr, "setting session id to: %s\n", buf );
rtsp->p_private->session = strdup( buf );
}
free( buf );
if( seq < 0 )
{
- fprintf(stderr, "warning: cseq not recognized!\n");
+ //fprintf(stderr, "warning: cseq not recognized!\n");
seq = 1;
}
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;
}
free( mrl_ptr );
- fprintf( stderr, "got mrl: %s %i %s\n", s->host, s->port, s->path );
+ //fprintf( stderr, "got mrl: %s %i %s\n", s->host, s->port, s->path );
s->s = rtsp->pf_connect( rtsp->p_userdata, s->host, s->port );
if( s->s < 0 )
{
- fprintf(stderr, "rtsp: failed to connect to '%s'\n", s->host);
+ //fprintf(stderr, "rtsp: failed to connect to '%s'\n", s->host);
rtsp_close( rtsp );
return -1;
}
}
/*
- * closes an rtsp connection
+ * closes an rtsp connection
*/
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 );
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);
}
}
/*
- * 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 )
{
if( !strncmp(*ptr, string, strlen(string)) ) break;
}
- if( *ptr ) free( *ptr );
+ free( *ptr );
ptr++;
do
{