rtcpbuffer: provide a WRITE map with maximum available size

... which allows adding additional packets and may be needed to counteract
the shrink that implicitly occurred during a map/unmap cycle when adding
a previous packet.
This commit is contained in:
Mark Nauwelaerts 2011-07-06 17:03:08 +02:00
parent 6be16ad773
commit 06557739ab

View file

@ -260,6 +260,13 @@ gst_rtcp_buffer_map (GstBuffer * buffer, GstMapFlags flags,
rtcp->flags = flags;
rtcp->data = gst_buffer_map (buffer, &rtcp->size, &rtcp->maxsize, flags);
/* allow for expansion, e.g. adding packets, if needed */
if ((flags & GST_MAP_WRITE) != 0) {
/* unmap and adjust to max available, and remap */
gst_buffer_unmap (buffer, rtcp->data, rtcp->maxsize);
rtcp->data = gst_buffer_map (buffer, &rtcp->size, &rtcp->maxsize, flags);
}
return TRUE;
}