[FFmpeg-devel] Can av_write_frame() modify pkt.data?

Michael Niedermayer michaelni
Tue Jun 17 18:49:17 CEST 2008

On Tue, Jun 17, 2008 at 06:28:57PM +0200, Reimar D?ffinger wrote:
> On Tue, Jun 17, 2008 at 03:05:07PM +0200, Michael Niedermayer wrote:
> > Besides a packet could be passed to more than 1 muxer and thus its content
> > must not be changed by any muxer.
> Maybe time to add a const to the function argument then :-) ?

We cant, because it isnt ...
a demuxer for example can keep a copy of the packet and then free it later
more specifically:

if(pkt->destruct == av_destruct_packet)
    pkt->destruct= NULL; // not shared -> must keep original from being freed
    av_dup_packet(&this_pktl->pkt);  //shared -> must dup

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080617/846d52f9/attachment.pgp>

More information about the ffmpeg-devel mailing list