From e526615355f07d97a6f488e224f9e823f7f5fdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> Date: Wed, 13 Aug 2014 21:03:29 +0300 Subject: [PATCH] input: avoid implicit upconversion to double --- src/input/input.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/input/input.c b/src/input/input.c index 1b080e33c0..91518ff737 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -1650,27 +1650,26 @@ static bool Control( input_thread_t *p_input, case INPUT_CONTROL_SET_POSITION: { - double f_pos; - if( p_input->p->b_recording ) { msg_Err( p_input, "INPUT_CONTROL_SET_POSITION(_OFFSET) ignored while recording" ); break; } - f_pos = val.f_float; + + float f_pos = val.f_float; if( i_type != INPUT_CONTROL_SET_POSITION ) f_pos += var_GetFloat( p_input, "position" ); - if( f_pos < 0.0 ) - f_pos = 0.0; - else if( f_pos > 1.0 ) - f_pos = 1.0; + if( f_pos < 0.f ) + f_pos = 0.f; + else if( f_pos > 1.f ) + f_pos = 1.f; /* Reset the decoders states and clock sync (before calling the demuxer */ es_out_SetTime( p_input->p->p_es_out, -1 ); if( demux_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION, - f_pos, !p_input->p->b_fast_seek ) ) + (double) f_pos, !p_input->p->b_fast_seek ) ) { msg_Err( p_input, "INPUT_CONTROL_SET_POSITION(_OFFSET) " - "%2.1f%% failed", f_pos * 100 ); + "%2.1f%% failed", (double)(f_pos * 100.f) ); } else { -- 2.25.4