[vlc-commits] input: fix resuming from pause at EOF (fixes #6490)

Rémi Denis-Courmont git at videolan.org
Thu Nov 17 21:34:46 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov 17 22:31:48 2016 +0200| [42c2b52b80710953227b8cee7747246fdbf86578] | committer: 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.

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

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

diff --git a/src/input/input.c b/src/input/input.c
index e440c50..cfcb92f 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -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
             {



More information about the vlc-commits mailing list