gst/avi/gstavimux.c: Fix...

Original commit message from CVS:
* gst/avi/gstavimux.c: (gst_avimux_write_tag),
(gst_avimux_riff_get_avi_header):
Fix...
This commit is contained in:
Ronald S. Bultje 2005-01-22 10:54:07 +00:00
parent 44e0ac6e5e
commit 1c3dc42d55
2 changed files with 14 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2005-01-22 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/avi/gstavimux.c: (gst_avimux_write_tag),
(gst_avimux_riff_get_avi_header):
Fix...
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net> 2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst-libs/gst/riff/riff-read.c: (gst_riff_peek_element_data), * gst-libs/gst/riff/riff-read.c: (gst_riff_peek_element_data),

View file

@ -593,6 +593,7 @@ gst_avimux_write_tag (const GstTagList * list, const gchar * tag, gpointer data)
}; };
gint n, len, plen; gint n, len, plen;
GstBuffer *buf = data; GstBuffer *buf = data;
guint8 *buffdata = GST_BUFFER_DATA (buf) + GST_BUFFER_SIZE (buf);
gchar *str; gchar *str;
for (n = 0; rifftags[n].fcc != 0; n++) { for (n = 0; rifftags[n].fcc != 0; n++) {
@ -603,15 +604,15 @@ gst_avimux_write_tag (const GstTagList * list, const gchar * tag, gpointer data)
if (plen & 1) if (plen & 1)
plen++; plen++;
if (GST_BUFFER_MAXSIZE (buf) >= GST_BUFFER_SIZE (buf) + 8 + plen) { if (GST_BUFFER_MAXSIZE (buf) >= GST_BUFFER_SIZE (buf) + 8 + plen) {
GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf), rifftags[n].fcc); GST_WRITE_UINT32_LE (buffdata, rifftags[n].fcc);
GST_WRITE_UINT32_LE (GST_BUFFER_DATA (buf) + 4, len + 1); GST_WRITE_UINT32_LE (buffdata + 4, len + 1);
memcpy (GST_BUFFER_DATA (buf) + 8, str, len); memcpy (buffdata + 8, str, len);
GST_BUFFER_DATA (buf)[8 + len] = 0; buffdata[8 + len] = 0;
GST_BUFFER_SIZE (buf) += 8 + plen; GST_BUFFER_SIZE (buf) += 8 + plen;
} }
}
break; break;
} }
}
} }
static GstBuffer * static GstBuffer *
@ -797,13 +798,13 @@ gst_avimux_riff_get_avi_header (GstAviMux * avimux)
buffdata = GST_BUFFER_DATA (buffer) + GST_BUFFER_SIZE (buffer); buffdata = GST_BUFFER_DATA (buffer) + GST_BUFFER_SIZE (buffer);
/* update list size */ /* update list size */
GST_WRITE_UINT32_LE (ptr, GST_BUFFER_SIZE (buffer) - startsize); GST_WRITE_UINT32_LE (ptr, GST_BUFFER_SIZE (buffer) - startsize - 4);
} }
/* avi data header */ /* avi data header */
memcpy (buffdata + 0, "LIST", 4); memcpy (buffdata + 0, "LIST", 4);
GST_WRITE_UINT32_LE (buffdata + 4, avimux->data_size); GST_WRITE_UINT32_LE (buffdata + 4, avimux->data_size);
memcpy (buffdata + 12, "movi", 4); memcpy (buffdata + 8, "movi", 4);
buffdata += 12; buffdata += 12;
GST_BUFFER_SIZE (buffer) += 12; GST_BUFFER_SIZE (buffer) += 12;