summaryrefslogtreecommitdiff
path: root/gst/rtp/gstrtpgstdepay.c
diff options
context:
space:
mode:
authorAndrzej Bieniek <andrzej.bieniek@pure.com>2012-10-31 16:09:26 +0000
committerWim Taymans <wim.taymans@collabora.co.uk>2012-11-01 11:27:13 +0000
commitee5ecc7773b5989190362eb29694ca5efe28c3fd (patch)
treea5a9baee793194fdb52d2aa807c28c194baf88fd /gst/rtp/gstrtpgstdepay.c
parentef0805ea14c3ab6ceebf8cbe8b572fca079b1290 (diff)
downloadgstreamer-plugins-good-ee5ecc7773b5989190362eb29694ca5efe28c3fd.tar.gz
depay: correctly skip caps header size
Conflicts: gst/rtp/gstrtpgstdepay.c
Diffstat (limited to 'gst/rtp/gstrtpgstdepay.c')
-rw-r--r--gst/rtp/gstrtpgstdepay.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gst/rtp/gstrtpgstdepay.c b/gst/rtp/gstrtpgstdepay.c
index 8c211b67f..2f6fdecaf 100644
--- a/gst/rtp/gstrtpgstdepay.c
+++ b/gst/rtp/gstrtpgstdepay.c
@@ -231,6 +231,8 @@ gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
/* C bit, we have inline caps */
gst_buffer_map (outbuf, &map, GST_MAP_READ);
+ GST_DEBUG_OBJECT (rtpgstdepay, "buffer size %u", map.size);
+
/* start reading the length, we need this to skip to the data later */
csize = offset = 0;
left = map.size;
@@ -243,6 +245,8 @@ gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
csize = (csize << 7) | (b & 0x7f);
} while (b & 0x80);
+ /* we have read csize, reduce remaining buffer size */
+ left -= offset;
if (left < csize) {
gst_buffer_unmap (outbuf, &map);
goto too_small;
@@ -259,8 +263,10 @@ gst_rtp_gst_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
GST_DEBUG_OBJECT (rtpgstdepay,
"inline caps %u, length %u, %" GST_PTR_FORMAT, CV, csize, outcaps);
+ GST_DEBUG_OBJECT (rtpgstdepay, "sub buffer: offset %u, size %u", offset,
+ left);
/* create real data buffer when needed */
- if (map.size)
+ if (left)
subbuf =
gst_buffer_copy_region (outbuf, GST_BUFFER_COPY_ALL, offset, left);
else