[vlc-commits] input: only check once if the demuxer has pf_demux

Steve Lhomme git at videolan.org
Tue Jun 7 11:32:38 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Jun  7 11:15:13 2016 +0200| [2e65b64cf90608459be58205e85b4e4613bbc582] | committer: Jean-Baptiste Kempf

input: only check once if the demuxer has pf_demux

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/input/input.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index d4acfda..1dd21d7 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -684,6 +684,9 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
     bool b_pause_after_eof = b_interactive &&
                              var_InheritBool( p_input, "play-and-pause" );
 
+    demux_t *p_demux = p_input->p->master->p_demux;
+    const bool b_can_demux = p_demux->pf_demux != NULL;
+
     while( !input_Stopped( p_input ) && p_input->p->i_state != ERROR_S )
     {
         mtime_t i_wakeup = -1;
@@ -703,7 +706,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
 
                 MainLoopDemux( p_input, &b_force_update );
 
-                if( p_input->p->master->p_demux->pf_demux != NULL )
+                if( b_can_demux )
                     i_wakeup = es_out_GetWakeup( p_input->p->p_es_out );
                 if( b_force_update )
                     i_intf_update = 0;



More information about the vlc-commits mailing list