[vlc-devel] commit: core: fix time-offset and position-offset callbacks ( Derk-Jan Hartman )

git version control git at videolan.org
Thu Jun 4 17:02:58 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Jun  4 16:48:50 2009 +0200| [4db53934dd02d9f2564a429ec9255279ae9e237c] | committer: Derk-Jan Hartman 

core: fix time-offset and position-offset callbacks

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4db53934dd02d9f2564a429ec9255279ae9e237c
---

 src/input/var.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/input/var.c b/src/input/var.c
index f13d700..955ca8e 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -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
     {




More information about the vlc-devel mailing list