Tim Starling <[EMAIL PROTECTED]> added the comment:

Obviously the correct solution would be to use bisection for seeking, as
suggested by the Ogg spec, instead of trying to guess the file position by
interpolating from the endpoints. In theory you could improve the worst case
performance of ogg_get_length() by a similar bisection algorithm. I can't see
how it would be O(N^2), but it may well end up reading significant amounts of
data twice, if the pages are large. It certainly is O(N) in the worst case. 

The issue is that without the patch, seeking is O(N), but it is a much slower
kind of O(N) -- a full decode of the theora stream rather than a scan of the ogg
packet headers. The patch vastly improves the execution time of a seek, for both
malicious and typical input. 

The patch is an absolutely necessary stopgap measure for our application. I'm
not intending on writing a bisection-based seek for ogg files any time soon. So
take it or leave it. 

Tabs replaced with four spaces for your convenience.

______________________________________________________
FFmpeg issue tracker <[EMAIL PROTECTED]>
<https://roundup.mplayerhq.hu/roundup/ffmpeg/issue159>
______________________________________________________

Reply via email to