[FFmpeg-devel] [PATCH]: examples/transcode_aac.c - Do not use global pts for frame pts counting

Nicolas George george at nsup.org
Tue May 11 18:01:09 EEST 2021


James Almer (12021-05-11):
> An alternative solution is introducing a struct containing all variables
> used by the process, including {input,output}_format_context,
> {input,output}_codec_context, resample_context, fifo, and pts, which will
> simplify the code a lot by making every function in the example take a
> single argument for all of them, so that should address your concerns about
> making the example more complex.

I agree, this would make the example more readable and clear.

> Our library usage examples should not result in people making mistakes like
> this when used as reference, so removing this global variable is a good
> idea.

If somebody follows the example without bothering to wonder what the
various pieces of code do, they will get something wrong.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210511/df3947cb/attachment.sig>


More information about the ffmpeg-devel mailing list