gst/typefind/gsttypefindfunctions.c: Add typefinder for PDF documents (which is nice...
authorJonathan Matthew <notverysmart@gmail.com>
Sat, 30 Aug 2008 15:55:06 +0000 (15:55 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Sat, 30 Aug 2008 15:55:06 +0000 (15:55 +0000)
Original commit message from CVS:
Patch by: Jonathan Matthew  <notverysmart gmail com>
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
Add typefinder for PDF documents (which is nice to have, since it's a
common format, but also helps prevent false positives). Fixes #549814.

ChangeLog
gst/typefind/gsttypefindfunctions.c

index 9bcf808..ffb171b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-30  Tim-Philipp Müller  <tim.muller at collabora co uk>
+
+       Patch by: Jonathan Matthew  <notverysmart gmail com>
+
+       * gst/typefind/gsttypefindfunctions.c: (plugin_init):
+         Add typefinder for PDF documents (which is nice to have, since it's a
+         common format, but also helps prevent false positives). Fixes #549814.
+
 2008-08-27  Wim Taymans  <wim.taymans@collabora.co.uk>
 
        * gst/playback/gstplaybin2.c: (selector_blocked), (pad_added_cb),
index 8c05db1..071dc6d 100644 (file)
@@ -3013,6 +3013,7 @@ plugin_init (GstPlugin * plugin)
   static gchar *nsf_exts[] = { "nsf", NULL };
   static gchar *mid_exts[] = { "mid", "midi", NULL };
   static gchar *imelody_exts[] = { "imy", "ime", "imelody", NULL };
+  static gchar *pdf_exts[] = { "pdf", NULL };
 
   GST_DEBUG_CATEGORY_INIT (type_find_debug, "typefindfunctions",
       GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions");
@@ -3220,6 +3221,8 @@ plugin_init (GstPlugin * plugin)
       vivo_type_find, vivo_exts, VIVO_CAPS, NULL, NULL);
   TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-nsf",
       GST_RANK_SECONDARY, nsf_exts, "NESM\x1a", 5, GST_TYPE_FIND_MAXIMUM);
+  TYPE_FIND_REGISTER_START_WITH (plugin, "application/pdf",
+      GST_RANK_SECONDARY, pdf_exts, "%PDF-", 5, GST_TYPE_FIND_LIKELY);
   return TRUE;
 }