flacparse: Don't parse the complete FLAC frames but only look for valid frame headers
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 7 Oct 2010 21:28:08 +0000 (23:28 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 8 Apr 2011 17:07:10 +0000 (18:07 +0100)
commit572366e17939b2eafd81838303c28320c92d314d
tree5351765e68c5d0aadd1a695168f0b47c4264b215
parentbfdc132ad05db01ad476d7cbf16d2fe600a6e510
flacparse: Don't parse the complete FLAC frames but only look for valid frame headers

Thanks to Felipe Contreras for the suggestion. This is partially
based on his patches and makes flacparse more than 3.5 times faster.

Looking for valid frame headers is unlikely to give false positives
because every frame header is at least 9 bytes long, contains a
14 bit sync code and a 8 bit checksum over the first 8 bytes.

Fixes bug #631200.
gst/audioparsers/gstflacparse.c
gst/audioparsers/gstflacparse.h