From: Tim-Philipp Müller Date: Wed, 18 Jun 2014 06:52:05 +0000 (+0100) Subject: rtph264pay: pre-allocate bufferlist of the right size X-Git-Tag: 1.3.3~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01ee993d8deaf82d2a275255a531150ec5cafcee;p=platform%2Fupstream%2Fgst-plugins-good.git rtph264pay: pre-allocate bufferlist of the right size To avoid unnecessary re-allocs. --- 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;