[vlc-devel] [PATCH 2/2] URational: handle also plain integers

Ilkka Ollakka ileoo at videolan.org
Sat Feb 15 11:58:56 CET 2014


On Sat, Feb 15, 2014 at 12:57:16PM +0200, ileoo at videolan.org wrote:

This is the patch I actually wanted to have reviewed and opinions, not the 1/2 in same series

> From: Ilkka Ollakka <ileoo at videolan.org>
> 
> ---
>  src/misc/variables.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/misc/variables.c b/src/misc/variables.c
> index e3d56b7..683cc36 100644
> --- a/src/misc/variables.c
> +++ b/src/misc/variables.c
> @@ -1282,6 +1282,10 @@ int (var_InheritURational)(vlc_object_t *object,
>  
>      if (n > 0 && d > 0)
>          vlc_ureduce(num, den, n, d, 0);
> +    else if (n > 0 ){ /* plain integer given */
> +        *num = n;
> +        *den = 1;
> +    }
>  
>      free(tmp);
>      return VLC_SUCCESS;
> -- 
> 1.8.5.2
> 



More information about the vlc-devel mailing list