[MPlayer-dev-eng] [PATCH] Use posix_fadvise in stream_file if available

Tobias Diedrich ranma at tdiedrich.de
Sun Nov 8 14:44:59 CET 2009


Reimar Döffinger wrote:
> The point is that since you use the POSIX_FADV_.. constants it is
> completely impossible to use this interface if e.g. Windows added
> a WindowsFadvise (ignoring the fact that your proposed code also
> wouldn't compile without it).

Yeah, I missed that, as I said it was late. :)
I intended to use my own enum in the header later, but it was just a
quick hack for now.

> I don't mind doing it like this, but then you'll have to define a proper
> API - minimum criteria would be that it can without issues be used on
> a system that only has readahead().
> You don't need to add support for that, but it should be possible
> without much of an issue.
> You should probably also consider a different type for len, so that e.g.
> -1 can be used to mean "some default value".
> And it will have to have proper doxygen-compatible documentation.

Hmm, AFAICS the javadoc-style documentation I used/copied from
osdep/mmap_anon.c is doxygen-compatible.

> Or you can use my attached ugly hack, assuming it works (I can't test,
> not even my DVDs have any problem with playing and seeking perfectly
> smooth even without cache).

I never had problems with lowres videos like DVDs, but ever since
switching to (Half-)HD I had to use the cache or in the cases where
the cache is broken (badly muxed files) prefetch the whole file into
ram using cat to avoid the occasional stuttering...
(1.5GHz Pentium M with rather slow 40GB HDD right now, but I also had
issues on my Athlon 4050e with fast and big HDDs)

-- 
Tobias						PGP: http://8ef7ddba.uguu.de



More information about the MPlayer-dev-eng mailing list