[vlc-devel] [VLC3 1/2] vlm: restart input on EOS or error

Romain Vimont rom1v at videolabs.io
Tue Jun 4 15:09:04 CEST 2019


If the current index matches the requested media, we must still restart
the input thread if it reached EOS or finished on error.
---
 src/input/vlm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/input/vlm.c b/src/input/vlm.c
index 2158233b5c..ed6a5bd3ff 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -966,9 +966,10 @@ static int vlm_ControlMediaInstanceStart( vlm_t *p_vlm, int64_t id, const char *
     input_thread_t *p_input = p_instance->p_input;
     if( p_input )
     {
-        if( p_instance->i_index == i_input_index )
+        int state = var_GetInteger( p_input, "state" );
+        if( p_instance->i_index == i_input_index &&
+                state != END_S && state != ERROR_S)
         {
-            int state = var_GetInteger( p_input, "state" );
             if( state == PAUSE_S )
                 var_SetInteger( p_input, "state",  PLAYING_S );
             return VLC_SUCCESS;
-- 
2.20.1



More information about the vlc-devel mailing list