[0.11] gst-plugins-base: rtcp: handle size update correctly
Wim Taymans
wtay at kemper.freedesktop.org
Thu Jan 19 06:33:22 PST 2012
Module: gst-plugins-base
Branch: 0.11
Commit: d9ef75b79954d2a2d1da5fca560072b8d172cebe
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=d9ef75b79954d2a2d1da5fca560072b8d172cebe
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Thu Jan 19 15:19:34 2012 +0100
rtcp: handle size update correctly
Do explicit resize to set the size of a buffer instead of setting a value in
unmap.
---
gst-libs/gst/rtp/gstrtcpbuffer.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gst-libs/gst/rtp/gstrtcpbuffer.c b/gst-libs/gst/rtp/gstrtcpbuffer.c
index fb99c4a..c3b2ebb 100644
--- a/gst-libs/gst/rtp/gstrtcpbuffer.c
+++ b/gst-libs/gst/rtp/gstrtcpbuffer.c
@@ -262,9 +262,8 @@ gst_rtcp_buffer_map (GstBuffer * buffer, GstMapFlags 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);
+ /* adjust to max available */
+ rtcp->size = rtcp->maxsize;
}
return TRUE;
@@ -294,6 +293,7 @@ gst_rtcp_buffer_unmap (GstRTCPBuffer * rtcp)
while (gst_rtcp_packet_move_to_next (&packet));
/* shrink size */
+ gst_buffer_resize (rtcp->buffer, 0, packet.offset);
res = gst_buffer_unmap (rtcp->buffer, rtcp->data, packet.offset);
rtcp->buffer = NULL;
More information about the gstreamer-commits
mailing list