typefindfunctions: Consider the number and types of atoms found in a row for suggesti...
authorSebastian Dröge <sebastian@centricular.com>
Tue, 19 Jan 2021 08:23:12 +0000 (10:23 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 31 Jan 2021 09:53:43 +0000 (11:53 +0200)
commit23370ec429fee5b3bf9a0a932fa135352640bd4e
tree3ed8279e48e9bf38a6e640cedb388d2dad9475f9
parent9ab400e26754e1c47accba2e135bf0990b0f04e4
typefindfunctions: Consider the number and types of atoms found in a row for suggesting a probability

If there are 3 or more known atoms in a row, it's likely that this is
actually MOV/MP4 even if we don't find any other known atoms. If 5 or
more are found then this is most certainly MOV/MP4 and we can return.

Also if a moov and mdat atom is found, this is definitely a MOV/MP4 file
and can be used as such, independent of anything else following the
mdat.

Fixes typefinding of various MOV files that have no `ftyp` atom but
otherwise a valid file structure followed by some garbage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1013>
gst/typefind/gsttypefindfunctions.c