summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-12-11 11:01:53 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-12-13 21:19:31 +0000
commitab0ffe161fcc5a8330d856b00a17e830285c2f03 (patch)
tree20756dfe63a0e14f8eb9a7f19e23bdf97cbe4c4b
parentf249b4c6d49d9a417d3d2d1ac9a80ee0098db326 (diff)
downloadgstreamer-plugins-base-ab0ffe161fcc5a8330d856b00a17e830285c2f03.tar.gz
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.
-rw-r--r--gst-libs/gst/rtp/gstrtpbasedepayload.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst-libs/gst/rtp/gstrtpbasedepayload.c b/gst-libs/gst/rtp/gstrtpbasedepayload.c
index a790c0f58..0eb8b89bf 100644
--- a/gst-libs/gst/rtp/gstrtpbasedepayload.c
+++ b/gst-libs/gst/rtp/gstrtpbasedepayload.c
@@ -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);
GST_BUFFER_FLAG_SET (in, GST_BUFFER_FLAG_DISCONT);
+ /* 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;
+ }
}
}