+2006-08-08 Tim-Philipp Müller <tim at centricular dot net>
+
+ Patch by: Sjoerd Simons <sjoerd at luon net>
+
+ * gst/typefind/gsttypefindfunctions.c: (multipart_type_find):
+ Better detection for multipart/x-mixed-replace: accept leading
+ whitespaces before the boundary marker as well (as our very own
+ multipartmux used to produce) (#349068).
+
2006-08-07 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Young-Ho Cha <ganadist at chollian net>
#define MULTIPART_CAPS gst_static_caps_get(&multipart_caps)
/* multipart/x-mixed replace is:
- * --<some ascii chars>[\r]\n
+ * <maybe some whitespace>--<some ascii chars>[\r]\n
* <more ascii chars>[\r]\nContent-type:<more ascii>[\r]\n */
static void
multipart_type_find (GstTypeFind * tf, gpointer unused)
guint8 *data;
guint8 *x;
- data = gst_type_find_peek (tf, 0, 2);
- if (!data || data[0] != '-' || data[1] != '-')
+#define MULTIPART_MAX_BOUNDARY_OFFSET 16
+ data = gst_type_find_peek (tf, 0, MULTIPART_MAX_BOUNDARY_OFFSET);
+ if (!data)
+ return;
+
+ for (x = data;
+ x - data < MULTIPART_MAX_BOUNDARY_OFFSET - 2 && g_ascii_isspace (*x);
+ x++);
+ if (x[0] != '-' || x[1] != '-')
return;
/* Could be okay, peek what should be enough for a complete header */