mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtcpbuffer: Don't try to modify read-only buffers
This commit is contained in:
parent
30af2fe7d6
commit
ab359d36d5
1 changed files with 8 additions and 5 deletions
|
@ -285,12 +285,15 @@ gst_rtcp_buffer_unmap (GstRTCPBuffer * rtcp)
|
|||
g_return_val_if_fail (rtcp != NULL, FALSE);
|
||||
g_return_val_if_fail (GST_IS_BUFFER (rtcp->buffer), FALSE);
|
||||
|
||||
/* move to the first free space */
|
||||
if (gst_rtcp_buffer_get_first_packet (rtcp, &packet))
|
||||
while (gst_rtcp_packet_move_to_next (&packet));
|
||||
if (rtcp->map.flags & GST_MAP_WRITE) {
|
||||
/* move to the first free space */
|
||||
if (gst_rtcp_buffer_get_first_packet (rtcp, &packet))
|
||||
while (gst_rtcp_packet_move_to_next (&packet));
|
||||
|
||||
/* shrink size */
|
||||
gst_buffer_resize (rtcp->buffer, 0, packet.offset);
|
||||
}
|
||||
|
||||
/* shrink size */
|
||||
gst_buffer_resize (rtcp->buffer, 0, packet.offset);
|
||||
gst_buffer_unmap (rtcp->buffer, &rtcp->map);
|
||||
rtcp->buffer = NULL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue