summaryrefslogtreecommitdiff
path: root/libavformat/avidec.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/avidec.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/avidec.c')
-rw-r--r--libavformat/avidec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 2277ef00bf..b235875c53 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -980,7 +980,9 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int err;
+#if FF_API_DESTRUCT_PACKET
void* dstr;
+#endif
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
@@ -1081,10 +1083,16 @@ resync:
}
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
+ AVBufferRef *avbuf = pkt->buf;
+#if FF_API_DESTRUCT_PACKET
dstr = pkt->destruct;
+#endif
size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
pkt->data, pkt->size);
+#if FF_API_DESTRUCT_PACKET
pkt->destruct = dstr;
+#endif
+ pkt->buf = avbuf;
pkt->flags |= AV_PKT_FLAG_KEY;
if (size < 0)
av_free_packet(pkt);