changeset 9394:d322325fc00e libavcodec

Get rid of av_destruct_packet_nofree and use NULL instead. It is still used in comparisons to keep ABI compatibility.
author reimar
date Sat, 11 Apr 2009 12:42:29 +0000
parents 25b3650b4db5
children 14e8350b27b4
files avcodec.h avpacket.c
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
 }
 
--- 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)