rtptheorapay: fix length encoding in packed headers.

As for vorbis payloader; this by inspection had the same bug.
This commit is contained in:
Michael Smith 2009-04-01 17:31:18 -07:00
parent 5f9d9e2243
commit 85d7fb0599

View file

@ -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;
}