Commit 8270cbac authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸

rtxsend: fix wrong memory layout assumption

The code responsible for creating retransmitted buffers
assumed the stored buffer had been created with
rtp_buffer_new_allocate when copying the extension data,
which isn't necessarily the case, for example when
the rtp buffers come from a udpsrc.
parent 4f8b34ab
......@@ -400,7 +400,10 @@ gst_rtp_rtx_buffer_new (GstRtpRtxSend * rtx, GstBuffer * buffer)
/* copy extension if any */
if (rtp.size[1]) {
mem = gst_memory_copy ([1].memory, 0, rtp.size[1]);
mem = gst_allocator_alloc (NULL, rtp.size[1], NULL);
gst_memory_map (mem, &map, GST_MAP_WRITE);
memcpy (,[1], rtp.size[1]);
gst_memory_unmap (mem, &map);
gst_buffer_append_memory (new_buffer, mem);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment