*****************************************************************************/
#include <vlc/vlc.h>
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h>
#include <vlc_demux.h>
#include <vlc_interface.h>
# include <winsock2.h>
#endif
+#include "UsageEnvironment.hh"
#include "BasicUsageEnvironment.hh"
#include "GroupsockHelper.hh"
#include "liveMedia.hh"
if( var_CreateGetBool( p_demux, "rtsp-http" ) )
i_http_port = var_CreateGetInteger( p_demux, "rtsp-http-port" );
- if( ( p_sys->rtsp = RTSPClient::createNew(*p_sys->env, 1 /*verbose*/,
+ if( ( p_sys->rtsp = RTSPClient::createNew(*p_sys->env,
+ p_demux->p_libvlc->i_verbose > 1,
"VLC media player", i_http_port ) ) == NULL )
{
msg_Err( p_demux, "RTSPClient::createNew failed (%s)",
}
else if( !strncmp( sub->codecName(), "G726", 4 ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 'g', '7', '2', '6' );
+ tk->fmt.i_codec = VLC_FOURCC( 'g', '7', '2', '6' );
tk->fmt.audio.i_rate = 8000;
tk->fmt.audio.i_channels = 1;
if( !strcmp( sub->codecName()+5, "40" ) )
}
else if( !strcmp( sub->codecName(), "SPEEX" ) )
{
- tk->fmt.i_codec = VLC_FOURCC( 's', 'p', 'x', ' ' );
+ tk->fmt.i_codec = VLC_FOURCC( 's', 'p', 'x', 'r' );
+ if ( sub->rtpTimestampFrequency() )
+ tk->fmt.audio.i_rate = sub->rtpTimestampFrequency();
+ else
+ {
+ msg_Warn( p_demux,"Using 8kHz as default sample rate." );
+ tk->fmt.audio.i_rate = 8000;
+ }
}
}
else if( !strcmp( sub->mediumName(), "video" ) )
/* Retrieve the timeout value and set up a timeout prevention thread */
p_sys->i_timeout = p_sys->rtsp->sessionTimeoutParameter();
- if( p_sys->i_timeout > 0 && !p_sys->p_timeout )
+ if( p_sys->i_timeout <= 0 )
+ p_sys->i_timeout = 60; /* default value from RFC2326 */
+ if( !p_sys->p_timeout )
{
msg_Dbg( p_demux, "We have a timeout of %d seconds", p_sys->i_timeout );
p_sys->p_timeout = (timeout_thread_t *)vlc_object_create( p_demux, sizeof(timeout_thread_t) );
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
tk->b_rtcp_sync = VLC_TRUE;
-#if 0
/* reset PCR */
tk->i_pts = 0;
p_sys->i_pcr = 0;
i_pcr = 0;
-#endif
}
}
}
/*****************************************************************************
- *
+ *
*****************************************************************************/
static void TimeoutPrevention( timeout_thread_t *p_timeout )
{