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

Michael Niedermayer michaelni at gmx.at
Wed Apr 23 01:10:32 CEST 2014


On Wed, Apr 23, 2014 at 12:56:18AM +0200, Stefano Sabatini wrote:
> 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).

sure, prefectly fine with me too

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140423/60271333/attachment.asc>


More information about the ffmpeg-devel mailing list