1 From 6ad17ea0835daec54df10f4aaadcd95f597dfa02 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
3 Date: Tue, 6 Oct 2009 10:33:20 +0100
4 Subject: [PATCH] typefinding: workaround for hangs with ID3-tagged m4a files
6 This works around a race condition in decodebin2/playbin2 in
7 the most low-risk and least intrusive way possible (NB#134099).
9 gst/typefind/gsttypefindfunctions.c | 7 +++++++
10 1 files changed, 7 insertions(+), 0 deletions(-)
12 diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
13 index 2a3a733..a6cfdeb 100644
14 --- a/gst/typefind/gsttypefindfunctions.c
15 +++ b/gst/typefind/gsttypefindfunctions.c
16 @@ -550,6 +550,13 @@ id3v1_type_find (GstTypeFind * tf, gpointer unused)
17 guint8 *data = gst_type_find_peek (tf, -128, 3);
19 if (data && memcmp (data, "TAG", 3) == 0) {
20 + /* HACK: don't typefind as ID3 if this looks like a quicktime/m4a file,
21 + * to avoid race condition/bug in decodebin2 that keeps id3demux ! qtdemux
22 + * from prerolling at times (Nokia Music Manager creates such files) */
23 + data = gst_type_find_peek (tf, 0, 8);
24 + if (data && memcmp (data + 4, "ftyp", 4) == 0)
27 gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, ID3_CAPS);