From 06557739ab8e9bf64a704262ec1fa3c05ec5079b Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 6 Jul 2011 17:03:08 +0200 Subject: [PATCH] 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. --- gst-libs/gst/rtp/gstrtcpbuffer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst-libs/gst/rtp/gstrtcpbuffer.c b/gst-libs/gst/rtp/gstrtcpbuffer.c index c1c9df6775..323c5cfc16 100644 --- a/gst-libs/gst/rtp/gstrtcpbuffer.c +++ b/gst-libs/gst/rtp/gstrtcpbuffer.c @@ -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; }