[FFmpeg-devel] On obfuscated nature of public(!) API call av_dup_packet()
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
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel