[FFmpeg-devel] Duplicating an AVPacket along with side data

Michael Niedermayer michaelni at gmx.at
Fri May 3 01:06:51 CEST 2013


On Thu, May 02, 2013 at 03:29:29PM -0700, Vignesh Venkatasubramanian wrote:
> Hi,
> 
> Right now av_dup_packet doesn't seem to duplicate side_data (after a
> very recent change). From what i understand, every call to
> av_dup_packet requires it's own call to av_free_packet (please correct
> me if i am wrong). The current behavior of av_dup_packet fails with
> the following workflow when side_data is present.

av_dup_packet() does nothing if all its "arrays" are "allocated"
please see the code, also you can take a look at the fork, it too
behaves this way and years ago it also was that way.

What av_dup_packet() does is allocate "arrays" when they point to
static arrays so that a packet can be kept longer than just for the
current "iteration"

side data was handled inconsistent with that and that was fixed.
If the current behavior causes more problems than it solves for most
users ?
then we sure could consider reverting that, but to me it seemed it
was just wrong and inconsistent before.

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- 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/20130503/05503b60/attachment.asc>


More information about the ffmpeg-devel mailing list