[FFmpeg-devel] On obfuscated nature of public(!) API call av_dup_packet()

Michael Niedermayer michaelni at gmx.at
Sat Sep 15 13:00:17 CEST 2012

On Sat, Sep 15, 2012 at 01:35:37PM +0300, Andrey Utkin wrote:
> 2012/9/15 Anton Khirnov <anton at khirnov.net>:
> > The thing is, this function is horribly named. It is not 'duplicate
> > supplied packet'.  It is 'ensure that supplied packet is backed by
> > malloced storage and thus will remain valid until the caller frees it'.
> > It does so by duplicating the packet payload when the free callback is
> > NULL.
> Then what about adding a function to mean "duplicate supplied packet"?

This can be done by copying the struct, setting the destructor to NULL
and calling av_dup_packet()
But we can add a function to do that if people prefer, maybe its
clearer as seperate function


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- 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/20120915/d3fe2f16/attachment.asc>

More information about the ffmpeg-devel mailing list