From 85d7fb059929d6583a04e00d0df9c4234fba85be Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 1 Apr 2009 17:31:18 -0700 Subject: [PATCH] rtptheorapay: fix length encoding in packed headers. As for vorbis payloader; this by inspection had the same bug. --- gst/rtp/gstrtptheorapay.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/rtp/gstrtptheorapay.c b/gst/rtp/gstrtptheorapay.c index 183d611fb8..890eddc4f3 100644 --- a/gst/rtp/gstrtptheorapay.c +++ b/gst/rtp/gstrtptheorapay.c @@ -353,6 +353,7 @@ gst_rtp_theora_pay_finish_headers (GstBaseRTPPayload * basepayload) GstBuffer *buf = GST_BUFFER_CAST (walk->data); guint bsize, size, temp; + guint flag; /* only need to store the length when it's not the last header */ if (!g_list_next (walk)) @@ -370,10 +371,12 @@ gst_rtp_theora_pay_finish_headers (GstBaseRTPPayload * basepayload) bsize = GST_BUFFER_SIZE (buf); /* write the size backwards */ + flag = 0; while (size) { size--; - data[size] = bsize & 0x7f; + data[size] = (bsize & 0x7f) | flag; bsize >>= 7; + flag = 0x80; } data += temp; }