Commit 42c2b52b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: fix resuming from pause at EOF (fixes #6490)

As things stood, the input was paused at EOF... and when resumed would
get straight back into pause.

This adds a flag to heep track of the occurrence of pause at EOF. If it
occurs a second time in a row, terminate the input thread loop.

If however the user seeks backward and resume, clear the flag and resume
playback normally.
parent 4d1a065d
......@@ -676,7 +676,8 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
ControlPause( p_input, mdate() );
bool b_pause_after_eof = b_interactive &&
var_InheritBool( p_input, "play-and-pause" );
var_InheritBool( p_input, "play-and-pause" );
bool b_paused_at_eof = false;
demux_t *p_demux = input_priv(p_input)->master->p_demux;
const bool b_can_demux = p_demux->pf_demux != NULL;
......@@ -704,6 +705,8 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
i_wakeup = es_out_GetWakeup( input_priv(p_input)->p_es_out );
if( b_force_update )
i_intf_update = 0;
b_paused_at_eof = false;
}
else if( !es_out_GetEmpty( input_priv(p_input)->p_es_out ) )
{
......@@ -714,12 +717,16 @@ static void MainLoop( input_thread_t *p_input, bool b_interactive )
* This way we won't trigger timeshifting for nothing */
else if( b_pause_after_eof && input_priv(p_input)->b_can_pause )
{
if( b_paused_at_eof )
break;
vlc_value_t val = { .i_int = PAUSE_S };
msg_Dbg( p_input, "pausing at EOF (pause after each)");
Control( p_input, INPUT_CONTROL_SET_STATE, val );
b_paused = true;
b_paused_at_eof = true;
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment