]> git.sesse.net Git - vlc/blobdiff - src/input/input_internal.h
input: Expose input_ItemHasErrorWhenReading.
[vlc] / src / input / input_internal.h
index 580b4fd79241153bf630a7a20ad8f90bd845bd7b..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
@@ -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;
-        p_input->i_state = val.i_int = state;
+        val.i_int = state;
         var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
     }
     if( changed )