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/rtpdec_qt.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/rtpdec_qt.c')
-rw-r--r-- | libavformat/rtpdec_qt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c index 6350507fc2..1222b4590d 100644 --- a/libavformat/rtpdec_qt.c +++ b/libavformat/rtpdec_qt.c @@ -186,12 +186,14 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt, memcpy(qt->pkt.data + qt->pkt.size, buf + avio_tell(&pb), alen); qt->pkt.size += alen; if (has_marker_bit) { - *pkt = qt->pkt; + int ret = av_packet_from_data(pkt, qt->pkt.data, qt->pkt.size); + if (ret < 0) + return ret; + qt->pkt.size = 0; qt->pkt.data = NULL; pkt->flags = flags & RTP_FLAG_KEY ? AV_PKT_FLAG_KEY : 0; pkt->stream_index = st->index; - pkt->destruct = av_destruct_packet; memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); return 0; } |