]> git.sesse.net Git - vlc/blobdiff - src/input/input_internal.h
input: Expose input_ItemHasErrorWhenReading.
[vlc] / src / input / input_internal.h
index 42f06de6150ce95e45509cc3140a20722b18ff2b..b0069e7f124d183c002cbb32e39735501603ea7f 100644 (file)
@@ -281,6 +281,7 @@ static inline void input_item_SetArtFetched( input_item_t *p_i, bool artfetched
         p_i->p_meta->i_status &= ~ITEM_ART_FETCHED;
 }
 
+void input_item_SetHasErrorWhenReading( input_item_t *p_i, bool error );
 
 /**********************************************************************
  * Item metadata
@@ -314,7 +315,7 @@ sout_instance_t * input_DetachSout( input_thread_t *p_input );
 
 /* var.c */
 void input_ControlVarInit ( input_thread_t * );
-void input_ControlVarClean( input_thread_t * );
+void input_ControlVarStop( input_thread_t * );
 void input_ControlVarNavigation( input_thread_t * );
 void input_ControlVarTitle( input_thread_t *, int i_title );
 
@@ -386,13 +387,20 @@ void MRLSplit( char *, const char **, const char **, char ** );
 
 static inline void input_ChangeStateWithVarCallback( input_thread_t *p_input, int state, bool callback )
 {
-    bool changed = (p_input->i_state != state);
+    const bool changed = p_input->i_state != state;
+
+    p_input->i_state = state;
+
+    input_item_SetHasErrorWhenReading( p_input->p->input.p_item, (state == ERROR_S) );
+
     if( callback )
-        var_SetInteger( p_input, "state", p_input->i_state = state );
+    {
+        var_SetInteger( p_input, "state", state );
+    }
     else
     {
         vlc_value_t val;
-        val.i_int = PLAYING_S;
+        val.i_int = state;
         var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
     }
     if( changed )