From f658f93c23312ca6585ddaf06bc09cf84771187f Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 21 Feb 2015 18:14:39 +0200 Subject: [PATCH] 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). --- 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 36d3b6d2d0..9f66169662 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; -- 2.39.5