[vlc-commits] access: live555: replace workaround vars with flags

Francois Cartegnie git at videolan.org
Mon Dec 4 15:09:50 CET 2017


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Dec  1 10:57:44 2017 +0100| [597873d66fb62bd0ad4e16b4553cb9dff2e66518] | committer: Jean-Baptiste Kempf

access: live555: replace workaround vars with flags

(cherry picked from commit 24c49aeccbe6c5d8512edff27416e67596f640b4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=597873d66fb62bd0ad4e16b4553cb9dff2e66518
---

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

diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index e5d9e735ca..a5f410c511 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -189,6 +189,9 @@ typedef struct
 
 class RTSPClientVlc;
 
+#define CAP_RATE_CONTROL        (1 << 1)
+#define CAPS_DEFAULT            CAP_RATE_CONTROL
+
 struct demux_sys_t
 {
     char            *p_sdp;    /* XXX mallocated */
@@ -199,6 +202,7 @@ struct demux_sys_t
     TaskScheduler    *scheduler;
     UsageEnvironment *env ;
     RTSPClientVlc    *rtsp;
+    int              capabilities; /* Server capabilities workaround */
 
     /* */
     int              i_track;
@@ -339,6 +343,13 @@ static int  Open ( vlc_object_t *p_this )
 
     msg_Dbg( p_demux, "version " LIVEMEDIA_LIBRARY_VERSION_STRING );
 
+    p_sys->capabilities = CAPS_DEFAULT;
+    if( var_GetBool( p_demux, "rtsp-kasenna" ) ||
+        var_GetBool( p_demux, "rtsp-wmserver" ) )
+    {
+        p_sys->capabilities &= ~CAP_RATE_CONTROL;
+    }
+
     TAB_INIT( p_sys->i_track, p_sys->track );
     p_sys->b_no_data = true;
     p_sys->b_force_mcast = var_InheritBool( p_demux, "rtsp-mcast" );
@@ -1615,9 +1626,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             pb = va_arg( args, bool * );
 
             *pb = (p_sys->rtsp != NULL) &&
-                    (p_sys->f_npt_length > 0) &&
-                    ( !var_GetBool( p_demux, "rtsp-kasenna" ) ||
-                      !var_GetBool( p_demux, "rtsp-wmserver" ) );
+                  (p_sys->f_npt_length > 0) &&
+                  (p_sys->capabilities & CAP_RATE_CONTROL);
             return VLC_SUCCESS;
 
         case DEMUX_SET_RATE:
@@ -1626,8 +1636,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             double f_scale, f_old_scale;
 
             if( !p_sys->rtsp || (p_sys->f_npt_length <= 0) ||
-                var_GetBool( p_demux, "rtsp-kasenna" ) ||
-                var_GetBool( p_demux, "rtsp-wmserver" ) )
+                !(p_sys->capabilities & CAP_RATE_CONTROL) )
                 return VLC_EGENERIC;
 
             /* According to RFC 2326 p56 chapter 12.35 a RTSP server that



More information about the vlc-commits mailing list