X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdemux%2Flive555.cpp;h=7e62c2c056d01e1c8742a535b1f89de5eb200ae5;hb=0da94177ecd5df425e4662aadb801309eadf1e0d;hp=41059191deceffba11fb47d0120d199e083f0ae6;hpb=ce29304981513f3e72d4fcfac9cae237313d08fd;p=vlc diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp index 41059191de..7e62c2c056 100644 --- a/modules/demux/live555.cpp +++ b/modules/demux/live555.cpp @@ -28,8 +28,6 @@ *****************************************************************************/ #include -#include /* malloc(), free() */ -#include #include #include @@ -41,6 +39,7 @@ # include #endif +#include "UsageEnvironment.hh" #include "BasicUsageEnvironment.hh" #include "GroupsockHelper.hh" #include "liveMedia.hh" @@ -222,11 +221,11 @@ static int Open ( vlc_object_t *p_this ) { /* See if it looks like a SDP v, o, s fields are mandatory and in this order */ - uint8_t *p_peek; + const uint8_t *p_peek; if( stream_Peek( p_demux->s, &p_peek, 7 ) < 7 ) return VLC_EGENERIC; - if( memcmp( (char*)p_peek, "v=0\r\n", 5 ) && - memcmp( (char*)p_peek, "v=0\n", 4 ) && + if( memcmp( p_peek, "v=0\r\n", 5 ) && + memcmp( p_peek, "v=0\n", 4 ) && ( p_peek[0] < 'a' || p_peek[0] > 'z' || p_peek[1] != '=' ) ) { return VLC_EGENERIC; @@ -441,7 +440,8 @@ createnew: 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)", @@ -675,7 +675,7 @@ static int SessionsSetup( demux_t *p_demux ) } 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" ) ) @@ -742,6 +742,17 @@ static int SessionsSetup( demux_t *p_demux ) { tk->b_quicktime = VLC_TRUE; } + else if( !strcmp( sub->codecName(), "SPEEX" ) ) + { + 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" ) ) { @@ -895,7 +906,9 @@ static int Play( demux_t *p_demux ) /* 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) ); @@ -1028,12 +1041,10 @@ static int Demux( demux_t *p_demux ) 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 } } @@ -1553,7 +1564,7 @@ static void TaskInterrupt( void *p_private ) } /***************************************************************************** - * + * *****************************************************************************/ static void TimeoutPrevention( timeout_thread_t *p_timeout ) {