]> git.sesse.net Git - vlc/blobdiff - src/input/input.c
* input: compute right value for position/time on position-offset and
[vlc] / src / input / input.c
index 139e6c5a847743d9afcb20218c103ae90c86ef78..1afa7f068bb99048bcf5f4dd4ba4545ea113377e 100644 (file)
@@ -211,6 +211,7 @@ input_thread_t *__input_CreateThread( vlc_object_t *p_parent,
 
     /* Access */
     p_input->p_access = NULL;
+    p_input->pf_access_control = NULL;
 
     p_input->i_bufsize = 0;
     p_input->i_mtu = 0;
@@ -1433,6 +1434,7 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
 
         newval.f_float += val.f_float;
     }
+    var_Change( p_input, "position", VLC_VAR_SETVALUE, &newval, NULL );
 
     vlc_mutex_lock( &p_input->stream.stream_lock );
     p_input->stream.p_selected_area->i_seek =
@@ -1464,11 +1466,17 @@ static int TimeCallback( vlc_object_t *p_this, char const *psz_cmd,
         val.f_float = (double)newval.i_time / (double)val.i_time;
         if( !strcmp( psz_cmd, "time-offset" ) )
         {
+            vlc_value_t t;
             var_Set( p_input, "position-offset", val );
+
+            var_Get( p_input, "time", &t );
+            t.i_time += newval.i_time;
+            var_Change( p_input, "time", VLC_VAR_SETVALUE, &t, NULL );
         }
         else
         {
             var_Set( p_input, "position", val );
+            var_Change( p_input, "time", VLC_VAR_SETVALUE, &newval, NULL );
         }
     }
     else