Commit ea7349e4 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

typefinding: improve iso media typefinding

... by also considering compatible brands rather than only aiming at major brand
(of which there are a seemingly ever expanding great many).
parent 3dad0493
......@@ -2545,7 +2545,26 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
tip = 0;
break;
}
size = GST_READ_UINT32_BE (data);
/* check compatible brands rather than ever expaning major brands above */
if ((STRNCMP (&data[4], "ftyp", 4) == 0) && (size >= 16)) {
new_offset = offset + 12;
while (new_offset + 4 <= offset + size) {
data = gst_type_find_peek (tf, new_offset, 4);
if (data == NULL)
goto done;
if (STRNCMP (&data[4], "isom", 4) == 0 ||
STRNCMP (&data[4], "avc1", 4) == 0 ||
STRNCMP (&data[4], "mp41", 4) == 0 ||
STRNCMP (&data[4], "mp42", 4) == 0) {
tip = GST_TYPE_FIND_MAXIMUM;
variant = "iso";
goto done;
}
new_offset += 4;
}
}
if (size == 1) {
guint8 *sizedata;
......@@ -2564,6 +2583,7 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
offset = new_offset;
}
done:
if (tip > 0) {
if (variant) {
GstCaps *caps = gst_caps_copy (QT_CAPS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment