summaryrefslogtreecommitdiff
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-10-31 16:09:26 +0000
commit2dbc11e77d0b08b018e2965a62c0e79ec324745f (patch)
treee55ac15a78e537545a7da1fa51c602c08216feb2
parente7941ef5134ec62f5500b0993aa5b5d741f7fb3b (diff)
depay: correctly skip caps header size
-rw-r--r--gst/rtp/gstrtpgstdepay.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/rtp/gstrtpgstdepay.c b/gst/rtp/gstrtpgstdepay.c
index b187db492..42dac7e24 100644
--- a/gst/rtp/gstrtpgstdepay.c
+++ b/gst/rtp/gstrtpgstdepay.c
@@ -236,6 +236,8 @@ gst_rtp_gst_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
data = GST_BUFFER_DATA (outbuf);
size = GST_BUFFER_SIZE (outbuf);
+ GST_DEBUG_OBJECT (rtpgstdepay, "buffer size %u", size);
+
/* start reading the length, we need this to skip to the data later */
csize = offset = 0;
do {
@@ -245,6 +247,8 @@ gst_rtp_gst_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
csize = (csize << 7) | (b & 0x7f);
} while (b & 0x80);
+ /* we have read csize, reduce remaining buffer size */
+ size -= offset;
if (size < csize)
goto too_small;
@@ -259,6 +263,8 @@ gst_rtp_gst_depay_process (GstBaseRTPDepayload * 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,
+ size);
/* create real data buffer when needed */
if (size)
subbuf = gst_buffer_create_sub (outbuf, offset, size);