mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
typefind: probe for DVD ISO files, to avoid matching H.264
https://bugzilla.gnome.org/show_bug.cgi?id=674069
This commit is contained in:
parent
512f96906e
commit
0bd8070ebd
1 changed files with 28 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue