rtpbasepayload: map RTP buffer READWRITE when setting headers

GstRTPHeaderExtension::write can map the RTP buffer for reading. If that
happens on a buffer that is already mapped WRITE-only by the payloader,
the payloader's mapping gets invalidated (GstRTPBuffer::map will point
to a different instance of GstMemory).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1173>
This commit is contained in:
Jakub Adam 2021-05-24 19:01:24 +02:00 committed by Jakub Adam
parent b4caa6cbdd
commit e2e9e321f6

View file

@ -1711,7 +1711,7 @@ set_headers (GstBuffer ** buffer, guint idx, gpointer user_data)
HeaderExt hdrext = { NULL, };
GstRTPBuffer rtp = { NULL, };
if (!gst_rtp_buffer_map (*buffer, GST_MAP_WRITE, &rtp))
if (!gst_rtp_buffer_map (*buffer, GST_MAP_READWRITE, &rtp))
goto map_failed;
gst_rtp_buffer_set_ssrc (&rtp, data->ssrc);