[vlc-commits] input: fix the rate sign check

Steve Lhomme git at videolan.org
Thu Jun 6 12:38:48 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun  5 13:54:35 2019 +0200| [a52d8b88a4f25ef0a75494e92bf0e7fe9ac0ed3a] | committer: Steve Lhomme

input: fix the rate sign check

fabsf( param.val.f_float ) cannot be negative.

Compilers should warn about this.

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

 src/input/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/input/input.c b/src/input/input.c
index a6116ab8e7..97ee9a6bb6 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1920,7 +1920,7 @@ static bool Control( input_thread_t *p_input,
         {
             /* Get rate and direction */
             float rate = fabsf( param.val.f_float );
-            int i_rate_sign = rate < 0 ? -1 : 1;
+            int i_rate_sign = param.val.f_float < 0 ? -1 : 1;
 
             /* Check rate bound */
             if( rate > INPUT_RATE_MAX )



More information about the vlc-commits mailing list