]> git.sesse.net Git - vlc/commitdiff
input/var.c: don't try to update the "rate" variable directly in callback
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 26 Apr 2005 21:35:03 +0000 (21:35 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 26 Apr 2005 21:35:03 +0000 (21:35 +0000)
for "rate-faster" and "rate-slower". input_ControlPush will handle it. This
fixes a race condition when "rate" ends up at a different value than
p_input->i_rate

src/input/var.c

index 40127c63c824704cd1e5d939070ad44ad96b92a3..2d669f882c50ad51ceb466b05d65e61741416bc1 100644 (file)
@@ -482,21 +482,10 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd,
     if( !strcmp( psz_cmd, "rate-slower" ) )
     {
         input_ControlPush( p_input, INPUT_CONTROL_SET_RATE_SLOWER, NULL );
-
-        /* Fix "rate" value */
-        i_rate = var_GetInteger( p_input, "rate" ) * 2;
-        if( i_rate < INPUT_RATE_MIN ) i_rate = INPUT_RATE_MIN;
-        val.i_int = i_rate;
-        var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
     }
     else if( !strcmp( psz_cmd, "rate-faster" ) )
     {
         input_ControlPush( p_input, INPUT_CONTROL_SET_RATE_FASTER, NULL );
-        i_rate = var_GetInteger( p_input, "rate" ) / 2;
-
-        if( i_rate > INPUT_RATE_MAX ) i_rate = INPUT_RATE_MAX;
-        val.i_int = i_rate;
-        var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
     }
     else
     {