From 179a5c37e070f619f14289bdc0fa66a08219eed9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 1 Nov 2012 14:03:04 +0100 Subject: rtpdec: factorize identical code used in several handlers --- libavformat/rtpdec_svq3.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libavformat/rtpdec_svq3.c') diff --git a/libavformat/rtpdec_svq3.c b/libavformat/rtpdec_svq3.c index bfc602ebb2..087a1e3346 100644 --- a/libavformat/rtpdec_svq3.c +++ b/libavformat/rtpdec_svq3.c @@ -97,12 +97,11 @@ static int svq3_parse_packet (AVFormatContext *s, PayloadContext *sv, avio_write(sv->pktbuf, buf, len); if (end_packet) { - av_init_packet(pkt); - pkt->stream_index = st->index; + int ret = ff_rtp_finalize_packet(pkt, &sv->pktbuf, st->index); + if (ret < 0) + return ret; + *timestamp = sv->timestamp; - pkt->size = avio_close_dyn_buf(sv->pktbuf, &pkt->data); - pkt->destruct = av_destruct_packet; - sv->pktbuf = NULL; return 0; } -- cgit v1.2.3