]> git.sesse.net Git - vlc/commitdiff
core: fix time-offset and position-offset callbacks
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 4 Jun 2009 14:48:50 +0000 (16:48 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 4 Jun 2009 14:53:40 +0000 (16:53 +0200)
When using the hotkeys to seek, each offset seek was executed twice. The bahavior of INPUT_CONTROL_SET_TIME_OFFSET has changed, and these callbacks did not account for that yet.

This closes #2820

src/input/var.c

index f13d700448a09c487a5112f1e19e5c28b799c0ef..955ca8e9fe492e89f80d9aa4a40b9dacf6c75692 100644 (file)
@@ -585,12 +585,11 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
 
     if( !strcmp( psz_cmd, "position-offset" ) )
     {
-        input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION_OFFSET, &newval );
-
         val.f_float = var_GetFloat( p_input, "position" ) + newval.f_float;
         if( val.f_float < 0.0 ) val.f_float = 0.0;
         if( val.f_float > 1.0 ) val.f_float = 1.0;
-        var_Change( p_input, "position", VLC_VAR_SETVALUE, &val, NULL );
+
+        input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION_OFFSET, &newval );
     }
     else
     {
@@ -618,11 +617,9 @@ static int TimeCallback( vlc_object_t *p_this, char const *psz_cmd,
 
     if( !strcmp( psz_cmd, "time-offset" ) )
     {
-        input_ControlPush( p_input, INPUT_CONTROL_SET_TIME_OFFSET, &newval );
         val.i_time = var_GetTime( p_input, "time" ) + newval.i_time;
         if( val.i_time < 0 ) val.i_time = 0;
-        /* TODO maybe test against i_length ? */
-        var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
+        input_ControlPush( p_input, INPUT_CONTROL_SET_TIME_OFFSET, &newval );
     }
     else
     {