#include <vlc_url.h>
#include <iostream>
+#include <limits.h>
#if defined( WIN32 )
# include <winsock2.h>
vlc_object_kill( p_sys->p_timeout );
vlc_thread_join( p_sys->p_timeout );
vlc_object_detach( p_sys->p_timeout );
- vlc_object_destroy( p_sys->p_timeout );
+ vlc_object_release( p_sys->p_timeout );
}
if( p_sys->scheduler ) delete p_sys->scheduler;
if( p_sys->p_sdp ) free( p_sys->p_sdp );
vlc_object_kill( p_sys->p_timeout );
vlc_thread_join( p_sys->p_timeout );
vlc_object_detach( p_sys->p_timeout );
- vlc_object_destroy( p_sys->p_timeout );
+ vlc_object_release( p_sys->p_timeout );
}
if( p_sys->scheduler ) delete p_sys->scheduler;
if( p_sys->p_sdp ) free( p_sys->p_sdp );
{
demux_sys_t *p_sys = p_demux->p_sys;
Authenticator authenticator;
+ vlc_bool_t b_firstpass = VLC_TRUE;
char *psz_user = NULL;
char *psz_pwd = NULL;
if( var_GetBool( p_demux, "rtsp-http" ) )
sscanf( psz_error, "%*s %*s HTTP GET %*s HTTP/%*u.%*u %3u %*s",
&i_code );
- else sscanf( psz_error, "%*sRTSP/%*s%3u", &i_code );
+ else
+ {
+ const char *psz_tmp = strstr( psz_error, "RTSP" );
+ sscanf( psz_tmp, "RTSP/%*s%3u", &i_code );
+ }
msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error );
+ if( b_firstpass )
+ { /* describeURL always returns an "RTSP/1.0 401 Unauthorized" the
+ * first time. This is a workaround to avoid asking for a
+ * user/passwd the first time the code passess here. */
+ i_code = 0;
+ b_firstpass = VLC_FALSE;
+ }
+
if( i_code == 401 )
{
int i_result;
VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
{
msg_Err( p_demux, "cannot spawn liveMedia timeout thread" );
- vlc_object_destroy( p_sys->p_timeout );
+ vlc_object_release( p_sys->p_timeout );
}
msg_Dbg( p_demux, "spawned timeout thread" );
vlc_object_attach( p_sys->p_timeout, p_demux );