Skip to content

Commit 2e65b64

Browse files
robUx4jbkempf
authored andcommitted
input: only check once if the demuxer has pf_demux
Signed-off-by: Jean-Baptiste Kempf <[email protected]>
1 parent d59500b commit 2e65b64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/input/input.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,9 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
684684
bool b_pause_after_eof = b_interactive &&
685685
var_InheritBool( p_input, "play-and-pause" );
686686

687+
demux_t *p_demux = p_input->p->master->p_demux;
688+
const bool b_can_demux = p_demux->pf_demux != NULL;
689+
687690
while( !input_Stopped( p_input ) && p_input->p->i_state != ERROR_S )
688691
{
689692
mtime_t i_wakeup = -1;
@@ -703,7 +706,7 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
703706

704707
MainLoopDemux( p_input, &b_force_update );
705708

706-
if( p_input->p->master->p_demux->pf_demux != NULL )
709+
if( b_can_demux )
707710
i_wakeup = es_out_GetWakeup( p_input->p->p_es_out );
708711
if( b_force_update )
709712
i_intf_update = 0;

0 commit comments

Comments
 (0)