[FFmpeg-devel] [PATCH] Make ffmpeg use parse_number_or_die instead of atoi

Stefano Sabatini stefano.sabatini-lala
Fri Mar 21 01:08:34 CET 2008


On date Friday 2008-03-07 01:34:07 +0100, Stefano Sabatini encoded:
> Hi,
> 
> as in $subject,
> 
> improves error management, diagnostic and reduces code size.
> 
> Note:
> 
> -    video_qscale = atof(arg);
> +    video_qscale = parse_number_or_die("qscale", arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
>      if (video_qscale <= 0 ||
>          video_qscale > 255) {
>          fprintf(stderr, "qscale must be > 0.0 and <= 255\n");
> 
> I didn't do:
> video_qscale = parse_number_or_die("qscale", arg, OPT_FLOAT, nextafter(0,1), 255)
> 
> because the resulting message for an error of the kind:
> ffmpeg -qscale 0
> 
> would result as: 
> "The value for qscale was 0 which is not within 0 - 255"
> 
> which is indeed quite confusing. Anyway the code for opt_qscale is
> going to be removed soon with the libavilter inclusion.
[...]

Two weeks interval passed... ping!

Please let me know if you're interested in this.

Regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-ffmpeg-use-parse-number-or-die-01.patch
Type: text/x-diff
Size: 5969 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080321/7a1cd389/attachment.patch>



More information about the ffmpeg-devel mailing list