[vlc-commits] input: tickless pause

Rémi Denis-Courmont git at videolan.org
Sat Feb 21 19:42:15 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 21 18:14:39 2015 +0200| [f658f93c23312ca6585ddaf06bc09cf84771187f] | committer: Rémi Denis-Courmont

input: tickless pause

Now we no longer update times and statistics in the control loop
(where it was kinda pointless). If there is no wake-up from the ES
output, then the input thread only needs to wait for control requests
- which means it can sleep without time-out.

In practice, that corresponds to the input thread being paused and
not buffering (buffering while paused is possible due to seek).

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

 src/input/input.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 36d3b6d..9f66169 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -684,7 +684,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
 
     while( vlc_object_alive( p_input ) && !p_input->b_error )
     {
-        mtime_t i_wakeup = 0;
+        mtime_t i_wakeup = -1;
         bool b_demux_polled = true;
         bool b_paused = p_input->p->i_state == PAUSE_S;
         /* FIXME if p_input->p->i_state == PAUSE_S the access/access_demux
@@ -743,10 +743,6 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
         {
             mtime_t i_deadline = i_wakeup;
 
-            if( b_paused || !b_demux_polled )
-                /* FIXME: remove this polling */
-                i_deadline = mdate() + INT64_C(250000);
-
             /* Postpone seeking until ES buffering is complete or at most
              * 125 ms. */
             bool b_postpone = es_out_GetBuffering( p_input->p->p_es_out )
@@ -757,7 +753,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
 
                 /* Recheck ES buffer level every 20 ms when seeking */
                 if( now < i_last_seek_mdate + INT64_C(125000)
-                 && i_deadline > now + INT64_C(20000) )
+                 && (i_deadline < 0 || i_deadline > now + INT64_C(20000)) )
                     i_deadline = now + INT64_C(20000);
                 else
                     b_postpone = false;



More information about the vlc-commits mailing list