aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec_svq3.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-01 14:03:04 +0100
committerAnton Khirnov <anton@khirnov.net>2012-11-02 07:58:37 +0100
commit179a5c37e070f619f14289bdc0fa66a08219eed9 (patch)
tree2713046a1df6cefc885e1411a79f8a508c784b84 /libavformat/rtpdec_svq3.c
parentf70381ab9d53132be2d009d6db9649b3cad8288b (diff)
downloadffmpeg-179a5c37e070f619f14289bdc0fa66a08219eed9.tar.gz
rtpdec: factorize identical code used in several handlers
Diffstat (limited to 'libavformat/rtpdec_svq3.c')
-rw-r--r--libavformat/rtpdec_svq3.c9
1 files changed, 4 insertions, 5 deletions
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;
}