aboutsummaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorAnton Khirnov2012-10-31 08:53:18 +0100
committerAnton Khirnov2013-03-08 07:33:45 +0100
commit1afddbe59e96af75f1c07605afc95615569f388f (patch)
tree0e8223d9813de6976ec50dc1a5a7c7bf9a099450 /libavformat/mux.c
parent1cec0624d0e6f48590283a57169b58b9fe8449d3 (diff)
avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases. This breaks ABI.
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c3
1 files changed, 3 insertions, 0 deletions
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) {