[FFmpeg-devel] [PATCH v8 2/2] fftools/ffmpeg: add exif orientation support per frame's metadata

Jun Li junli1026 at gmail.com
Sun Jun 9 07:39:32 EEST 2019

On Sat, Jun 8, 2019 at 2:25 AM Nicolas George <george at nsup.org> wrote:

> Jun Li (12019-06-07):
> > I think a complete validation should be creating a function like
> "atodigit"
> > , string to digit, instead of using atoi,
> The problem of validation is a common one, and as such it already has a
> solution.
>     The atoi() function is subsumed by strtol() but is retained because it
> is
>     used extensively in existing code. If the number is not known to be in
>     range, strtol() should be used because atoi() is not required to
> perform
>     any error checking.

Thanks Nicolas and Michael, it is very helpful.
After reread the exif orientation doc, I realized that the correct value
should be in range [1,8], that is, 0 is considered as invalid.

So the new version is still using "atoi", since it return 0 for either
input  "0" or "This is a test", and 0 considered as invalid in any case.
I am not against using strtol, which is a superset of atoi. Let me know if
there is a code preference in ffmpeg since I see strtol is more widely used.

Best Regards,

> --
>   Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-devel mailing list