On Thu, 19 Jun 2008, Stas Oskin wrote: > Hi. > > This might be related to my case as well. > > From what I found av_dup_packet() takes the memory shared by 2 > packets, and make it non/shared via mem_cpy(). Is it correct?
Yes, but it is only relevant for the memory used by the packet data buffer. The pts, dts and other members of the AVPacket structure are not shared obviously. > It means also that simple assign does not copies the packet > structures, but merely makes a reference? Everything is copied except the data payload buffer. Only a pointer to it is copied, so it still refers the the original area in memory that the old packet did. Any change to this location in memory will affect both packets. If you want to reuse the old AVPacket but keep a copy of the new packet, you must create a duplicate copy of the packet buffer using av_dup_packet(). I stand open to correction by someone with a clearer explanation.. _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
