--- /dev/null
+From 7ba7157378dcc9c73da475ee1fcb2590da4a7104 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
+Date: Thu, 22 Oct 2009 10:06:04 +0100
+Subject: [PATCH] typefinding: extend workaround to ID3-tagged ASF, WAV and
+ AVI files.
+
+NB #142716.
+---
+ gst/typefind/gsttypefindfunctions.c | 20 +++++++++++++++-----
+ 1 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
+index a6cfdeb..c44b653 100644
+--- a/gst/typefind/gsttypefindfunctions.c
++++ b/gst/typefind/gsttypefindfunctions.c
+@@ -551,11 +551,21 @@ id3v1_type_find (GstTypeFind * tf, gpointer unused)
+
+ if (data && memcmp (data, "TAG", 3) == 0) {
+ /* HACK: don't typefind as ID3 if this looks like a quicktime/m4a file,
+- * to avoid race condition/bug in decodebin2 that keeps id3demux ! qtdemux
+- * from prerolling at times (Nokia Music Manager creates such files) */
+- data = gst_type_find_peek (tf, 0, 8);
+- if (data && memcmp (data + 4, "ftyp", 4) == 0)
+- return;
++ * (or an ASF or WAV/AVI file) to avoid race condition/bug in decodebin2
++ * that keeps id3demux ! qtdemux and similar pipelines from prerolling
++ * at times (Nokia Music Manager creates such files) */
++ data = gst_type_find_peek (tf, 0, 16);
++ if (data) {
++ const guint8 asf_marker[16] = { 0x30, 0x26, 0xb2, 0x75, 0x8e, 0x66,
++ 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
++ };
++
++ if (memcmp (data + 4, "ftyp", 4) == 0 ||
++ memcmp (data, asf_marker, 16) == 0 ||
++ (memcmp (data, "RIFF", 4) == 0 && memcmp (data + 8, "AVI", 3) == 0)) {
++ return;
++ }
++ }
+
+ gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, ID3_CAPS);
+ }