[vlc-commits] Revert "WIP: live555"

Rémi Denis-Courmont git at videolan.org
Sat Aug 6 21:12:03 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug  6 21:34:40 2016 +0300| [50e5c8d144135b04055f3a5afbcca3c30a5d49e2] | committer: Rémi Denis-Courmont

Revert "WIP: live555"

This reverts commit 1a966f080a00edef9ecbb49e769f462dab204811.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=50e5c8d144135b04055f3a5afbcca3c30a5d49e2
---

 modules/access/live555.cpp | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index ffca911..bc5a9fa 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -209,8 +209,8 @@ struct demux_sys_t
     double           f_npt_start;
 
     /* timeout thread information */
-    mtime_t          next_refresh;
-    unsigned         interval;     /* session timeout value in seconds */
+    int              i_timeout;     /* session timeout value in seconds */
+    bool             b_timeout_call;/* mark to send an RTSP call to prevent server timeout */
     timeout_thread_t *p_timeout;    /* the actual thread that makes sure we don't timeout */
     vlc_mutex_t      timeout_mutex; /* Serialise calls to live555 in timeout thread w.r.t. Demux()/Control() */
 
@@ -1232,19 +1232,15 @@ static int Play( demux_t *p_demux )
         }
 
         /* Retrieve the timeout value and set up a timeout prevention thread */
-        int interval = p_sys->rtsp->sessionTimeoutParameter();
-        if( interval <= 2 )
-            interval = 60; /* default value from RFC2326 */
-
-        p_sys->interval = interval - 2;
-        p_sys->next_refresh = mdate() + CLOCK_FREQ * interval;
+        p_sys->i_timeout = p_sys->rtsp->sessionTimeoutParameter();
+        if( p_sys->i_timeout <= 0 )
+            p_sys->i_timeout = 60; /* default value from RFC2326 */
 
         /* start timeout-thread. GET_PARAMETER will be used if supported by
          * the server. OPTIONS will be used as a fallback */
         if( !p_sys->p_timeout )
         {
-            msg_Dbg( p_demux, "We have a timeout of %u seconds",
-                     p_sys->interval );
+            msg_Dbg( p_demux, "We have a timeout of %d seconds",  p_sys->i_timeout );
             p_sys->p_timeout = (timeout_thread_t *)malloc( sizeof(timeout_thread_t) );
             if( p_sys->p_timeout )
             {
@@ -1292,7 +1288,7 @@ static int Demux( demux_t *p_demux )
     vlc_mutex_locker locker(&p_sys->timeout_mutex);
 
     /* Check if we need to send the server a Keep-A-Live signal */
-    if( p_sys->rtsp && p_sys->ms && mdate() >= p_sys->next_refresh )
+    if( p_sys->b_timeout_call && p_sys->rtsp && p_sys->ms )
     {
         char *psz_bye = NULL;
         /* Use GET_PARAMETERS if supported. wmserver dialect supports
@@ -1302,7 +1298,7 @@ static int Demux( demux_t *p_demux )
         else
             p_sys->rtsp->sendOptionsCommand(NULL, NULL);
 
-        p_sys->next_refresh = mdate() + CLOCK_FREQ * p_sys->interval;
+        p_sys->b_timeout_call = false;
     }
 
     for( i = 0; i < p_sys->i_track; i++ )
@@ -2151,10 +2147,10 @@ static void* TimeoutPrevention( void *p_data )
             }
 
             vlc_restorecancel (canc);
-            p_sys->next_refresh = mdate() + CLOCK_FREQ * p_sys->interval;
         }
+        p_sys->b_timeout_call = !p_timeout->b_handle_keep_alive;
 
-        mwait(p_sys->next_refresh);
+        msleep (((int64_t)p_sys->i_timeout - 2) * CLOCK_FREQ);
     }
     vlc_assert_unreachable(); /* dead code */
 }



More information about the vlc-commits mailing list