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

Rémi Denis-Courmont remi at remlab.net
Sat Feb 15 12:27:00 CET 2014


Le samedi 15 février 2014, 12:57:16 ileoo at videolan.org a écrit :
> 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 */

I believe the predicate is *next == '\0' for a plain integer.

> +        *num = n;
> +        *den = 1;
> +    }
> 
>      free(tmp);
>      return VLC_SUCCESS;

-- 
Реми Денис-Курмон
http://www.remlab.net/




More information about the vlc-devel mailing list