From 1afddbe59e96af75f1c07605afc95615569f388f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 31 Oct 2012 08:53:18 +0100 Subject: avpacket: use AVBuffer to allow refcounting the packets. This will allow us to avoid copying the packets in many cases. This breaks ABI. --- libavformat/mux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/mux.c') diff --git a/libavformat/mux.c b/libavformat/mux.c index f7a7f3a2c9..cb3c297a6b 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -420,7 +420,10 @@ void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, this_pktl = av_mallocz(sizeof(AVPacketList)); this_pktl->pkt = *pkt; +#if FF_API_DESTRUCT_PACKET pkt->destruct = NULL; // do not free original but only the copy +#endif + pkt->buf = NULL; av_dup_packet(&this_pktl->pkt); // duplicate the packet if it uses non-alloced memory if (s->streams[pkt->stream_index]->last_in_packet_buffer) { -- cgit v1.2.3