Commit f0db396e authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

rtpbasedepay: when setting discont flag make sure rtpbuffer is current

Depayloaders will look at rtpbuffer->buffer for the discont flag.
When we set the discont flag on a buffer in the rtp base depayloader
and we have to make the buffer writable, make sure the rtpbuffer
actually contains the newly-flagged buffer, not the original input
buffer. This was introduced with the addition of the process_rtp_packet
vfunc, but would only trigger if the input buffer wasn't flagged
already and was not writable already.
parent 29cd7966
......@@ -426,11 +426,21 @@ gst_rtp_base_depayload_handle_buffer (GstRTPBaseDepayload * filter,
if (G_UNLIKELY (discont)) {
priv->discont = TRUE;
if (!buf_discont) {
gpointer old_inbuf = in;
/* we detected a seqnum discont but the buffer was not flagged with a discont,
* set the discont flag so that the subclass can throw away old data. */
GST_LOG_OBJECT (filter, "mark DISCONT on input buffer");
in = gst_buffer_make_writable (in);
/* depayloaders will check flag on rtpbuffer->buffer, so if the input
* buffer was not writable already we need to remap to make our
* newly-flagged buffer current on the rtpbuffer */
if (in != old_inbuf) {
gst_rtp_buffer_unmap (&rtp);
if (G_UNLIKELY (!gst_rtp_buffer_map (in, GST_MAP_READ, &rtp)))
goto invalid_buffer;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment