[vlc-devel] commit: Fixed seeking while paused (visible with high caching). ( Laurent Aimar )

git version control git at videolan.org
Sat Nov 29 10:53:16 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Nov 25 20:59:17 2008 +0100| [5708e0cd1cdc41e3cc325cd63bd91eed8537f3dd] | committer: Laurent Aimar 

Fixed seeking while paused (visible with high caching).

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

 src/input/clock.c  |    3 ---
 src/input/es_out.c |   11 +++++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/input/clock.c b/src/input/clock.c
index 1655629..f215f94 100644
--- a/src/input/clock.c
+++ b/src/input/clock.c
@@ -395,9 +395,6 @@ void input_clock_ChangeSystemOrigin( input_clock_t *cl, mtime_t i_system )
     cl->ref.i_system += i_offset;
     cl->last.i_system += i_offset;
 
-    if( cl->b_paused )
-        cl->i_pause_date = i_system;
-
     vlc_mutex_unlock( &cl->lock );
 }
 
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 2ea5a80..125370a 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -147,6 +147,7 @@ struct es_out_sys_t
 
     /* */
     bool        b_paused;
+    mtime_t     i_pause_date;
 
     /* Current preroll */
     mtime_t     i_preroll_end;
@@ -301,6 +302,7 @@ es_out_t *input_EsOutNew( input_thread_t *p_input, int i_rate )
     p_sys->i_spu_delay  = 0;
 
     p_sys->b_paused = false;
+    p_sys->i_pause_date = -1;
 
     p_sys->i_rate = i_rate;
 
@@ -556,6 +558,7 @@ static void EsOutChangePause( es_out_t *out, bool b_paused, mtime_t i_date )
         EsOutProgramsChangeRate( out );
     }
     p_sys->b_paused = b_paused;
+    p_sys->i_pause_date = i_date;
 }
 
 static void EsOutChangeRate( es_out_t *out, int i_rate )
@@ -654,10 +657,10 @@ static void EsOutDecodersStopBuffering( es_out_t *out, bool b_forced )
     msg_Dbg( p_sys->p_input, "Decoder buffering done in %d ms",
               (int)(mdate() - i_decoder_buffering_start)/1000 );
 
-    const mtime_t i_ts_delay = 10*1000 + /* FIXME CLEANUP thread wake up time*/
-                               mdate();
-    //msg_Dbg( p_sys->p_input, "==> %lld", i_ts_delay - p_sys->p_input->i_pts_delay );
-    input_clock_ChangeSystemOrigin( p_sys->p_pgrm->p_clock, i_ts_delay - i_buffering_duration );
+    const mtime_t i_wakeup_delay = 10*1000; /* FIXME CLEANUP thread wake up time*/
+    const mtime_t i_current_date = p_sys->b_paused ? p_sys->i_pause_date : mdate();
+
+    input_clock_ChangeSystemOrigin( p_sys->p_pgrm->p_clock, i_current_date + i_wakeup_delay - i_buffering_duration );
 
     for( int i = 0; i < p_sys->i_es; i++ )
     {




More information about the vlc-devel mailing list