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

git version control git at videolan.org
Thu Jun 4 20:08:58 CEST 2009


vlc | branch: 1.0-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Thu Jun  4 16:48:50 2009 +0200| [d4f549f7aabb4b165f01f49bbc5ed04a2945d613] | 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
(cherry picked from commit 4db53934dd02d9f2564a429ec9255279ae9e237c)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 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