[vlc-commits] input: avoid implicit upconversion to double
Rémi Denis-Courmont
git at videolan.org
Wed Aug 13 20:29:13 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Aug 13 21:03:29 2014 +0300| [e526615355f07d97a6f488e224f9e823f7f5fdc9] | committer: Rémi Denis-Courmont
input: avoid implicit upconversion to double
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e526615355f07d97a6f488e224f9e823f7f5fdc9
---
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 1b080e3..91518ff 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
{
More information about the vlc-commits
mailing list