diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-10-31 08:53:18 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:33:45 +0100 |
commit | 1afddbe59e96af75f1c07605afc95615569f388f (patch) | |
tree | 0e8223d9813de6976ec50dc1a5a7c7bf9a099450 /libavformat/rtpdec.c | |
parent | 1cec0624d0e6f48590283a57169b58b9fe8449d3 (diff) | |
download | ffmpeg-1afddbe59e96af75f1c07605afc95615569f388f.tar.gz |
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/rtpdec.c')
-rw-r--r-- | libavformat/rtpdec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index f734b91cbe..6652842441 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -864,11 +864,15 @@ int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p, int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx) { + int ret; av_init_packet(pkt); pkt->size = avio_close_dyn_buf(*dyn_buf, &pkt->data); pkt->stream_index = stream_idx; - pkt->destruct = av_destruct_packet; - *dyn_buf = NULL; + *dyn_buf = NULL; + if ((ret = av_packet_from_data(pkt, pkt->data, pkt->size)) < 0) { + av_freep(&pkt->data); + return ret; + } return pkt->size; } |