diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-10-31 11:53:18 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 10:33:45 +0400 |
commit | 1afddbe59e96af75f1c07605afc95615569f388f (patch) | |
tree | 0e8223d9813de6976ec50dc1a5a7c7bf9a099450 /libavformat/avidec.c | |
parent | 1cec0624d0e6f48590283a57169b58b9fe8449d3 (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.c | 8 |
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); |