rtph264pay: pre-allocate bufferlist of the right size

To avoid unnecessary re-allocs.
This commit is contained in:
Tim-Philipp Müller 2014-06-18 07:52:05 +01:00
parent c7c72c00b1
commit 01ee993d8d

View file

@ -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;