[FFmpeg-cvslog] lavc: preserve avpkt->destruct in ff_alloc_packet().

Anton Khirnov git at videolan.org
Sun Mar 4 04:47:42 CET 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Feb 24 22:39:19 2012 +0100| [e42e9b0e4d3eb8b2c9b5e1791344f211b590040c] | committer: Anton Khirnov

lavc: preserve avpkt->destruct in ff_alloc_packet().

Also, don't bother with saving/restoring data, av_init_packet doesn't
touch it.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e42e9b0e4d3eb8b2c9b5e1791344f211b590040c
---

 libavcodec/utils.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d797c8a..a91eab1 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -838,14 +838,13 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
         return AVERROR(EINVAL);
 
     if (avpkt->data) {
-        uint8_t *pkt_data;
+        void *destruct = avpkt->destruct;
 
         if (avpkt->size < size)
             return AVERROR(EINVAL);
 
-        pkt_data = avpkt->data;
         av_init_packet(avpkt);
-        avpkt->data = pkt_data;
+        avpkt->destruct = destruct;
         avpkt->size = size;
         return 0;
     } else {



More information about the ffmpeg-cvslog mailing list