 +        else {
 +          const char *text = (const char*) GST_BUFFER_DATA(buf);
 +          size_t text_len = GST_BUFFER_SIZE(buf);
-+          GST_LOG_OBJECT (ke, "Encoding text: %s (%u bytes) from %f to %f", GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf), t0, t1);
++          GST_LOG_OBJECT (ke, "Encoding text: %*.*s (%u bytes) from %f to %f", (int)text_len, (int)text_len, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf), t0, t1);
 +          ret = kate_encode_text(&ke->k, t0, t1, text, text_len, &kp);
 +          if (ret >= 0)
 +            packet_ready = TRUE;

+
+#endif /* __GST_KATE_DEC_H__ */
--- /dev/null	2008-04-05 19:24:09.000000000 +0100
+++ gst-plugins-bad/ext/kate/gstkateenc.c	2008-06-30 07:38:05.000000000 +0100
@@ -0,0 +1,1529 @@
+/*
+ * GStreamer
+ * Copyright 2005 Thomas Vander Stichele <thomas@apestaart.org>

+  GValue array = { 0 };
+  GValue value = { 0 };
+
+  g_assert (parse);
+
+  if (!caps) return GST_FLOW_ERROR;
+  if (!parse->streamheader) return GST_FLOW_ERROR;
+
+  structure = gst_caps_get_structure (caps, 0);
+
+  headers = parse->streamheader;
+  g_value_init (&array, GST_TYPE_ARRAY);
+  while (headers) {
