On Tue, Dec 14, 2021 at 04:30:04PM -0300, James Almer wrote:
> On 12/14/2021 3:54 PM, Nicolas George wrote:
> > James Almer (12021-12-14):
> > > We add a const uint8_t* field to AVChannelCustom. If the user wants to
> > > allocate the strings instead, and not worry about their lifetime, they can
> > > provide the layout with a custom free() function that will take care of
> > > cleaning anything they came up with on uninit().
> > 
> > I understood what you suggested, and it amounts to letting API users
> > fend for themselves. We can do that, but I would prefer if we only did
> > on last resort, if we do not find a more convenient solution.
> 
> There's "char name[16]". Bigger than a pointer (Could be 8 bytes instead,
> but then it's kinda small). The user will not have to worry about the
> lifetime of anything then.

the advantages of a fixed length array are
* no dynamic allocation (overhead, complexity, error handling)
* no refcounting
* easier to cleanly display in user interfaces than arbitrary length strings
* no question about what to do with overly long strings (mb, gb?)

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to