summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.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.c
parentf70381ab9d53132be2d009d6db9649b3cad8288b (diff)
rtpdec: factorize identical code used in several handlers
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index d16122d40d..a305dd6957 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -803,3 +803,14 @@ int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p,
av_free(value);
return 0;
}
+
+int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx)
+{
+ 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;
+ return pkt->size;
+}