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

Tobias Diedrich ranma+mplayer at tdiedrich.de
Sat Nov 7 19:37:30 CET 2009


This complements OS read-ahead by explicitly telling the OS what
parts of the file we will likely read in the future.
The advantage over the normal MPlayer cache is that it doesn't need
the second process and it handles frequent seeks of the demuxer
better.
For me this improves playback for files with -nocache.
No more occasional stuttering on the 2 files I tested so far.
(dropped pagecache using /proc/sys/vm/drop_caches before starting playback)
I've been avoiding -cache lately since for quite a few (badly
muxed?) .mp4s the demuxer seems to seek a lot and makes the cache
behaviour pathologically bad.
Note that I did not compile test the 'posix_fadvise not supported'
case so far...
For now the prefetch is fixed at 1MB, but it should be easy
to automatically adjust it based on the read rate.

-- 
Tobias						PGP: http://8ef7ddba.uguu.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-fadvise.patch
Type: text/x-diff
Size: 7227 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20091107/214371ba/attachment.patch>


More information about the MPlayer-dev-eng mailing list