mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
rtcp: handle size update correctly
Do explicit resize to set the size of a buffer instead of setting a value in unmap.
This commit is contained in:
parent
5be917d5bd
commit
d9ef75b799
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue