On Sun, Aug 31, 2014 at 04:15:51PM +0200, wm4 wrote: > Well yes, it would be possible to loop over the entire probe buffer, > until it ends on a packet boundary, or there's a partial cut-off > packet. How exactly would you suggest the probe score? > > Personally, I'd probably do the following: if the header of the first > packet is available (i.e. "PG" magic), then return SCORE_EXTENSION-1. > If the probe buffer is large enough to include the header of the next > packet, and the next packet has no magic (i.e. probably invalid), > return 0. Otherwise, return SCORE_EXTENSION+1.
I would extend this by: If more than 10 found, return max score (to allow detecting without extension, and also to allow playing files where only a later part is corrupted, plus it avoids scanning too much). Since 10 would be less than 640 kB probe buffer (usually much less) there's probably no need for special-handling of anything in-between, beyond what you suggested. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel