# HG changeset patch # User reimar # Date 1239453749 0 # Node ID d322325fc00eb28e241095169404c914b3d687e8 # Parent 25b3650b4db5d388f0c46879faff424f12f76c05 Get rid of av_destruct_packet_nofree and use NULL instead. It is still used in comparisons to keep ABI compatibility. diff -r 25b3650b4db5 -r d322325fc00e avcodec.h --- a/avcodec.h Sat Apr 11 11:47:15 2009 +0000 +++ b/avcodec.h Sat Apr 11 12:42:29 2009 +0000 @@ -2630,7 +2630,10 @@ /* packet functions */ -void av_destruct_packet_nofree(AVPacket *pkt); +/** + * @deprecated use NULL instead + */ +attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt); /** * Default packet destructor. @@ -2675,8 +2678,9 @@ */ static inline void av_free_packet(AVPacket *pkt) { - if (pkt && pkt->destruct) { - pkt->destruct(pkt); + if (pkt) { + if (pkt->destruct) pkt->destruct(pkt); + pkt->data = NULL; pkt->size = 0; } } diff -r 25b3650b4db5 -r d322325fc00e avpacket.c --- a/avpacket.c Sat Apr 11 11:47:15 2009 +0000 +++ b/avpacket.c Sat Apr 11 12:42:29 2009 +0000 @@ -42,7 +42,7 @@ pkt->convergence_duration = 0; pkt->flags = 0; pkt->stream_index = 0; - pkt->destruct= av_destruct_packet_nofree; + pkt->destruct= NULL; } int av_new_packet(AVPacket *pkt, int size)