]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Get rid of av_destruct_packet_nofree and use NULL instead.
authorreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 12:42:29 +0000 (12:42 +0000)
committerreimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 11 Apr 2009 12:42:29 +0000 (12:42 +0000)
It is still used in comparisons to keep ABI compatibility.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18431 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/avcodec.h
libavcodec/avpacket.c
libavformat/utils.c

index f500151e8568a71ae6a4e6072612b00525903f86..cb64d82f93da09261f798758e0e93fcccf5bb414 100644 (file)
@@ -2630,7 +2630,10 @@ typedef struct AVSubtitle {
 
 /* 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 @@ int av_dup_packet(AVPacket *pkt);
  */
 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;
     }
 }
 
index d91ee3a10d021bd9c4090ea9d2f6c36b62439bf8..194324713f5fd852acd3af63408517b8412ae070 100644 (file)
@@ -42,7 +42,7 @@ void av_init_packet(AVPacket *pkt)
     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)
index d209fe712f6920eb83e97b7421febde759b1181f..535da9896548d192045102cf9acc69294aa9c83d 100644 (file)
@@ -923,7 +923,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
                     pkt->pts = st->parser->pts;
                     pkt->dts = st->parser->dts;
                     pkt->pos = st->parser->pos;
-                    pkt->destruct = av_destruct_packet_nofree;
+                    pkt->destruct = NULL;
                     compute_pkt_fields(s, st, st->parser, pkt);
 
                     if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & PKT_FLAG_KEY){