Commit 8d263243 authored by Clément Stenac's avatar Clément Stenac

Don't use %f in VLM, except for display (Closes:#588)

parent 019ee285
...@@ -1234,11 +1234,15 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id, ...@@ -1234,11 +1234,15 @@ int vlm_MediaControl( vlm_t *vlm, vlm_media_t *media, const char *psz_id,
vlc_value_t val; vlc_value_t val;
float f_percentage; float f_percentage;
if( psz_args && sscanf( psz_args, "%f", &f_percentage ) == 1 ) if( psz_args )
{ {
val.f_float = f_percentage / 100.0 ; f_percentage = i18n_atof( psz_args );
var_Set( p_instance->p_input, "position", val ); if( f_percentage >= 0.0 && f_percentage <= 100.0 )
return VLC_SUCCESS; {
val.f_float = f_percentage / 100.0 ;
var_Set( p_instance->p_input, "position", val );
return VLC_SUCCESS;
}
} }
} }
else if( !strcmp( psz_command, "stop" ) ) else if( !strcmp( psz_command, "stop" ) )
...@@ -2312,8 +2316,8 @@ int vlm_MediaVodControl( void *p_private, vod_media_t *p_vod_media, ...@@ -2312,8 +2316,8 @@ int vlm_MediaVodControl( void *p_private, vod_media_t *p_vod_media,
{ {
double f_pos = (double)va_arg( args, double ); double f_pos = (double)va_arg( args, double );
char psz_pos[50]; char psz_pos[50];
lldiv_t div = lldiv( f_pos * 10000000, 10000000 );
sprintf( psz_pos, "%f", f_pos ); sprintf( psz_pos, I64Fd".%07u", div.quot, (unsigned int) div.rem );
i_ret = vlm_MediaControl( vlm, vlm->media[i], psz_id, "seek", psz_pos); i_ret = vlm_MediaControl( vlm, vlm->media[i], psz_id, "seek", psz_pos);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment