[FFmpeg-devel] [PATCH] ffprobe: fix scaling of vali

Stefano Sabatini stefasab at gmail.com
Wed Apr 23 00:56:18 CEST 2014


On date Monday 2014-04-21 13:06:36 +0200, Michael Niedermayer encoded:
> Fixes Ticket3523
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  ffprobe.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index 9e39ff7..bc2497c 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -217,7 +217,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
>          vald = uv.val.d;
>          show_float = 1;
>      } else {
> -        vald = vali = uv.val.i;
> +        vald = uv.val.i;
>      }
>  
>      if (uv.unit == unit_second_str && use_value_sexagesimal_format) {
> @@ -247,8 +247,9 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
>                  prefix_string = decimal_unit_prefixes[index];
>              }
>          }
> +        vali = vald;
>  
> -        if (show_float || (use_value_prefix && vald != (long long int)vald))
> +        if (show_float || (use_value_prefix && vald != vali))
>              snprintf(buf, buf_size, "%f", vald);
>          else
>              snprintf(buf, buf_size, "%lld", vali);

Probably simpler in attachment (rescaling and lossy int->double
conversion only done in case -prefix is used).
-- 
FFmpeg = Fanciful & Faithless Most Prodigious Entertaining Gorilla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ffprobe-fix-scaling-of-vali-in-value_string-in-case-.patch
Type: text/x-diff
Size: 768 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140423/99fef245/attachment.bin>


More information about the ffmpeg-devel mailing list