[FFmpeg-cvslog] r18431 - in trunk: libavcodec/avcodec.h libavcodec/avpacket.c libavformat/utils.c

reimar subversion
Sat Apr 11 14:42:29 CEST 2009


Author: reimar
Date: Sat Apr 11 14:42:29 2009
New Revision: 18431

Log:
Get rid of av_destruct_packet_nofree and use NULL instead.
It is still used in comparisons to keep ABI compatibility.

Modified:
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/avpacket.c
   trunk/libavformat/utils.c

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Sat Apr 11 13:47:15 2009	(r18430)
+++ trunk/libavcodec/avcodec.h	Sat Apr 11 14:42:29 2009	(r18431)
@@ -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;
     }
 }
 

Modified: trunk/libavcodec/avpacket.c
==============================================================================
--- trunk/libavcodec/avpacket.c	Sat Apr 11 13:47:15 2009	(r18430)
+++ trunk/libavcodec/avpacket.c	Sat Apr 11 14:42:29 2009	(r18431)
@@ -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)

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	Sat Apr 11 13:47:15 2009	(r18430)
+++ trunk/libavformat/utils.c	Sat Apr 11 14:42:29 2009	(r18431)
@@ -923,7 +923,7 @@ static int av_read_frame_internal(AVForm
                     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){



More information about the ffmpeg-cvslog mailing list