Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / debian / patches / 0017-typefinding-extend-workaround-to-ID3-tagged-ASF-WAV-.patch
1 From 7ba7157378dcc9c73da475ee1fcb2590da4a7104 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
3 Date: Thu, 22 Oct 2009 10:06:04 +0100
4 Subject: [PATCH] typefinding: extend workaround to ID3-tagged ASF, WAV and
5  AVI files.
6
7 NB #142716.
8 ---
9  gst/typefind/gsttypefindfunctions.c |   20 +++++++++++++++-----
10  1 files changed, 15 insertions(+), 5 deletions(-)
11
12 diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
13 index a6cfdeb..c44b653 100644
14 --- a/gst/typefind/gsttypefindfunctions.c
15 +++ b/gst/typefind/gsttypefindfunctions.c
16 @@ -551,11 +551,21 @@ id3v1_type_find (GstTypeFind * tf, gpointer unused)
17  
18    if (data && memcmp (data, "TAG", 3) == 0) {
19      /* HACK: don't typefind as ID3 if this looks like a quicktime/m4a file,
20 -     * to avoid race condition/bug in decodebin2 that keeps id3demux ! qtdemux
21 -     * from prerolling at times (Nokia Music Manager creates such files) */
22 -    data = gst_type_find_peek (tf, 0, 8);
23 -    if (data && memcmp (data + 4, "ftyp", 4) == 0)
24 -      return;
25 +     * (or an ASF or WAV/AVI file) to avoid race condition/bug in decodebin2
26 +     * that keeps id3demux ! qtdemux and similar pipelines from prerolling
27 +     * at times (Nokia Music Manager creates such files) */
28 +    data = gst_type_find_peek (tf, 0, 16);
29 +    if (data) {
30 +      const guint8 asf_marker[16] = { 0x30, 0x26, 0xb2, 0x75, 0x8e, 0x66,
31 +        0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
32 +      };
33 +
34 +      if (memcmp (data + 4, "ftyp", 4) == 0 ||
35 +          memcmp (data, asf_marker, 16) == 0 ||
36 +          (memcmp (data, "RIFF", 4) == 0 && memcmp (data + 8, "AVI", 3) == 0)) {
37 +        return;
38 +      }
39 +    }
40  
41      gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, ID3_CAPS);
42    }