]> git.sesse.net Git - vlc/blobdiff - modules/demux/live555.cpp
Removes trailing spaces. Removes tabs.
[vlc] / modules / demux / live555.cpp
index 4e1731704a4b5b9f5df886fce491b3b7f4d7fc98..a603f12b96441dd413b5fea67d429346ef67af62 100644 (file)
@@ -28,8 +28,6 @@
  *****************************************************************************/
 
 #include <vlc/vlc.h>
-#include <stdlib.h>                                      /* malloc(), free() */
-#include <string.h>
 
 #include <vlc_demux.h>
 #include <vlc_interface.h>
@@ -222,11 +220,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 +439,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 +674,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" ) )
@@ -899,7 +898,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) );
@@ -1557,7 +1558,7 @@ static void TaskInterrupt( void *p_private )
 }
 
 /*****************************************************************************
- *  
+ *
  *****************************************************************************/
 static void TimeoutPrevention( timeout_thread_t *p_timeout )
 {