[vlc-devel] commit: live555 : delay RTSP PAUSE command while in paused state ( Sébastien Escudier )

git version control git at videolan.org
Wed Sep 2 19:11:13 CEST 2009


vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Mon Aug 31 16:33:28 2009 +0200| [0b3d5d0e27a70a07b1a75ae9028cc7eb65ea5d7b] | committer: Rémi Denis-Courmont 

live555 : delay RTSP PAUSE command while in paused state

Otherwise, the seek command would unpause the stream and that's not
what vlc is expecting.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/demux/live555.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 8507aef..1b35afa 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -224,6 +224,8 @@ struct demux_sys_t
 
     bool             b_get_param;   /* Does the server support GET_PARAMETER */
     bool             b_paused;      /* Are we paused? */
+
+    float            f_seek_request;/* In case we receive a seek request while paused*/
 };
 
 static int Demux  ( demux_t * );
@@ -303,6 +305,7 @@ static int  Open ( vlc_object_t *p_this )
     p_sys->b_force_mcast = var_CreateGetBool( p_demux, "rtsp-mcast" );
     p_sys->b_get_param = false;
     p_sys->b_paused = false;
+    p_sys->f_seek_request = -1;
 
     /* parse URL for rtsp://[user:[passwd]@]serverip:port/options */
     vlc_UrlParse( &p_sys->url, p_sys->psz_path, 0 );
@@ -1284,9 +1287,15 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                     time = f * (double)p_sys->i_npt_length;   /* in second */
                 }
 
-                if( !p_sys->b_paused && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ))
+                if( p_sys->b_paused )
+                {
+                    p_sys->f_seek_request = time;
+                    return VLC_SUCCESS;
+                }
+
+                if( !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) )
                 {
-                    msg_Err( p_demux, "PAUSE before seek failed failed %s",
+                    msg_Err( p_demux, "PAUSE before seek failed %s",
                         p_sys->env->getResultMsg() );
                     return VLC_EGENERIC;
                 }
@@ -1414,11 +1423,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 return VLC_SUCCESS;
             if( ( b_pause && !p_sys->rtsp->pauseMediaSession( *p_sys->ms ) ) ||
                     ( !b_pause && !p_sys->rtsp->playMediaSession( *p_sys->ms,
-                       -1 ) ) )
+                       p_sys->f_seek_request ) ) )
             {
                     msg_Err( p_demux, "PLAY or PAUSE failed %s", p_sys->env->getResultMsg() );
                     return VLC_EGENERIC;
             }
+            p_sys->f_seek_request = -1;
             p_sys->b_paused = b_pause;
 
             /* When we Pause, we'll need the TimeoutPrevention thread to




More information about the vlc-devel mailing list