From 01ee993d8deaf82d2a275255a531150ec5cafcee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 18 Jun 2014 07:52:05 +0100 Subject: [PATCH] rtph264pay: pre-allocate bufferlist of the right size To avoid unnecessary re-allocs. --- gst/rtp/gstrtph264pay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c index 1ad7668..7c6c821 100644 --- a/gst/rtp/gstrtph264pay.c +++ b/gst/rtp/gstrtph264pay.c @@ -869,7 +869,7 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload, /* We keep 2 bytes for FU indicator and FU Header */ payload_len = gst_rtp_buffer_calc_payload_len (mtu - 2, 0, 0); - list = gst_buffer_list_new (); + list = gst_buffer_list_new_sized ((size / payload_len) + 1); while (end == 0) { limitedSize = size < payload_len ? size : payload_len; -- 2.7.4