From 1afddbe59e96af75f1c07605afc95615569f388f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 31 Oct 2012 08:53:18 +0100 Subject: avpacket: use AVBuffer to allow refcounting the packets. This will allow us to avoid copying the packets in many cases. This breaks ABI. --- libavformat/rtpdec_qt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libavformat/rtpdec_qt.c') 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; } -- cgit v1.2.3