[vlc-devel] commit: (live555) fix seeking (Jean-Paul Saman )

git version control git at videolan.org
Mon Nov 24 15:06:38 CET 2008


vlc | branch: 0.8.6-bugfix | Jean-Paul Saman <jpsaman at videolan.org> | Sun Nov 23 17:01:58 2008 +0100| [cd68641e016d079a6e2eacafc3e21ae03495bcaf] | committer: Jean-Paul Saman 

(live555) fix seeking

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

 modules/demux/live555.cpp |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 69e6361..6247e3e 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -1261,21 +1261,32 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:
-            float time;
-
             f = (double)va_arg( args, double );
             if( p_sys->rtsp && p_sys->i_length > 0 )
             {
+                float time;
+                int i;
+
                 time = f * (double)p_sys->i_length / 1000000.0;   /* in second */
-                if( !p_sys->rtsp->playMediaSession( *p_sys->ms, time ) )
+                if( !p_sys->rtsp->playMediaSession( *p_sys->ms, time, -1, 1 ) )
                 {
                     msg_Err( p_demux, "PLAY failed %s",
                         p_sys->env->getResultMsg() );
                     return VLC_EGENERIC;
                 }
-                p_sys->i_start = (int64_t)(f * (double)p_sys->i_length);
-                p_sys->i_pcr_start = 0;
-                p_sys->i_pcr       = 0;
+                p_sys->i_pcr = 0;
+
+                for( i = 0; i < p_sys->i_track; i++ )
+                {
+                    p_sys->track[i]->b_rtcp_sync = VLC_FALSE;
+                    p_sys->track[i]->i_pts = 0;
+                    es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
+                }
+
+                p_sys->i_pcr = p_sys->i_pcr_start = p_sys->ms->playStartTime();
+                p_sys->i_length = (int64_t)((double) p_sys->ms->playEndTime() * 1000000.0);
+                msg_Dbg( p_demux, "seek start: %lld stop: %lld",
+                         p_sys->i_pcr_start, p_sys->i_length );
 
                 return VLC_SUCCESS;
             }




More information about the vlc-devel mailing list