- val.i_time = newval.i_time;
- input_ControlPush( p_input, INPUT_CONTROL_SET_TIME, &newval );
- }
+ /* Update "position" for better intf behavour */
+ const mtime_t i_length = var_GetTime( p_input, "length" );
+ if( i_length > 0 && newval.i_time >= 0 && newval.i_time <= i_length )
+ {
+ vlc_value_t val;
+
+ val.f_float = (double)newval.i_time/(double)i_length;
+ var_Change( p_input, "position", VLC_VAR_SETVALUE, &val, NULL );
+ /*
+ * Notify the intf that a new event has been occurred.
+ * XXX this is a bit hackish but it's the only way to do it now.
+ */
+ var_SetInteger( p_input, "intf-event", INPUT_EVENT_POSITION );
+ }