summaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec_xiph.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtpdec_xiph.c')
-rw-r--r--libavformat/rtpdec_xiph.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c
index 38f12bb..40415d8 100644
--- a/libavformat/rtpdec_xiph.c
+++ b/libavformat/rtpdec_xiph.c
@@ -202,20 +202,13 @@ static int xiph_handle_packet(AVFormatContext * ctx,
if (fragmented == 3) {
// end of xiph data packet
- av_init_packet(pkt);
- pkt->size = avio_close_dyn_buf(data->fragment, &pkt->data);
-
- if (pkt->size < 0) {
+ int ret = ff_rtp_finalize_packet(pkt, &data->fragment, st->index);
+ if (ret < 0) {
av_log(ctx, AV_LOG_ERROR,
"Error occurred when getting fragment buffer.");
- return pkt->size;
+ return ret;
}
- pkt->stream_index = st->index;
- pkt->destruct = av_destruct_packet;
-
- data->fragment = NULL;
-
return 0;
}
}
OpenPOWER on IntegriCloud