summaryrefslogtreecommitdiff
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-31 08:53:18 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 07:33:45 +0100
commit1afddbe59e96af75f1c07605afc95615569f388f (patch)
tree0e8223d9813de6976ec50dc1a5a7c7bf9a099450 /libavformat/mp3enc.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/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index c969777255..4d7c798c95 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -343,7 +343,11 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
return AVERROR(ENOMEM);
pktl->pkt = *pkt;
- pkt->destruct = NULL;
+ pktl->pkt.buf = av_buffer_ref(pkt->buf);
+ if (!pktl->pkt.buf) {
+ av_freep(&pktl);
+ return AVERROR(ENOMEM);
+ }
if (mp3->queue_end)
mp3->queue_end->next = pktl;