[vlc-commits] input: remove unused "position-offset" variable

Rémi Denis-Courmont git at videolan.org
Wed Jun 15 21:32:38 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 15 22:32:12 2016 +0300| [b296f18c024a7d890e0d1cd655725d1e7f32ea17] | committer: Rémi Denis-Courmont

input: remove unused "position-offset" variable

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

 include/vlc_input.h |    2 +-
 src/input/var.c     |   34 ++++++++++------------------------
 2 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 16a6a49..22f3dfa 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -272,7 +272,7 @@ struct input_thread_t
  * The read-write variables are:
  *  - state (\see input_state_e)
  *  - rate
- *  - position, position-offset
+ *  - position
  *  - time, time-offset
  *  - title, next-title, prev-title
  *  - chapter, next-chapter, next-chapter-prev
diff --git a/src/input/var.c b/src/input/var.c
index 437c614..f3eca1d 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -91,7 +91,6 @@ static const vlc_input_callback_t p_input_callbacks[] =
     CALLBACK( "state", StateCallback ),
     CALLBACK( "rate", RateCallback ),
     CALLBACK( "position", PositionCallback ),
-    CALLBACK( "position-offset", PositionCallback ),
     CALLBACK( "time", TimeCallback ),
     CALLBACK( "time-offset", TimeOffsetCallback ),
     CALLBACK( "bookmark", BookmarkCallback ),
@@ -146,7 +145,6 @@ void input_ControlVarInit ( input_thread_t *p_input )
 
     /* Position */
     var_Create( p_input, "position",  VLC_VAR_FLOAT );
-    var_Create( p_input, "position-offset",  VLC_VAR_FLOAT );
 
     /* Time */
     var_Create( p_input, "time", VLC_VAR_INTEGER );
@@ -586,32 +584,20 @@ static int PositionCallback( vlc_object_t *p_this, char const *psz_cmd,
                              void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
-    if( !strcmp( psz_cmd, "position-offset" ) )
-    {
-        float f_position = var_GetFloat( p_input, "position" ) + newval.f_float;
-        if( f_position < 0.f )
-            f_position = 0.f;
-        else if( f_position > 1.f )
-            f_position = 1.f;
-        var_SetFloat( p_this, "position", f_position );
-    }
-    else
-    {
-        /* Update "length" for better intf behaviour */
-        const int64_t i_length = var_GetInteger( p_input, "length" );
-        if( i_length > 0 && newval.f_float >= 0.f && newval.f_float <= 1.f )
-        {
-            vlc_value_t val;
+    VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
 
-            val.i_int = i_length * newval.f_float;
-            var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
-        }
+    /* Update "length" for better intf behaviour */
+    const int64_t i_length = var_GetInteger( p_input, "length" );
+    if( i_length > 0 && newval.f_float >= 0.f && newval.f_float <= 1.f )
+    {
+        vlc_value_t val;
 
-        /* */
-        input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION, &newval );
+        val.i_int = i_length * newval.f_float;
+        var_Change( p_input, "time", VLC_VAR_SETVALUE, &val, NULL );
     }
+
+    input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION, &newval );
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list