diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 8e8c5dfa31..10ac1594c7 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -4568,6 +4568,32 @@ degas_type_find (GstTypeFind * tf, gpointer private) } } +/*** DVD ISO images (looks like H.264, see #674069) ***/ +static void +dvdiso_type_find (GstTypeFind * tf, gpointer private) +{ + /* 0x8000 bytes of zeros, then "\001CD001" */ + gint64 len; + const guint8 *data; + + len = gst_type_find_get_length (tf); + if (len < 0x8006) + return; + data = gst_type_find_peek (tf, 0, 0x8006); + if (G_UNLIKELY (data == NULL)) + return; + for (len = 0; len < 0x8000; len++) + if (data[len]) + return; + /* Can the '1' be anything else ? My three samples all have '1'. */ + if (memcmp (data + 0x8000, "\001CD001", 6)) + return; + + /* May need more inspection, we may be able to demux some of them */ + gst_type_find_suggest_simple (tf, GST_TYPE_FIND_LIKELY, + "application/octet-stream", NULL); +} + /*** generic typefind for streams that have some data at a specific position***/ typedef struct { @@ -4939,6 +4965,8 @@ plugin_init (GstPlugin * plugin) TYPE_FIND_REGISTER (plugin, "image/x-degas", GST_RANK_MARGINAL, degas_type_find, NULL, NULL, NULL, NULL); + TYPE_FIND_REGISTER (plugin, "application/octet-stream", GST_RANK_MARGINAL, + dvdiso_type_find, NULL, NULL, NULL, NULL); return TRUE; }