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

Tobias Diedrich ranma at tdiedrich.de
Sat Nov 7 20:11:50 CET 2009


Reimar Döffinger wrote:
> Also I don't think this is supposed to be s->pos, like this you'll
> advise the kernel to read ahead the data it just read while almost
> certainly it would make more sense to tell the kernel to drop that part.
> off_t pos = lseek(s->fd, 0, SEEK_CUR);
> int r = read(s->fd,buffer,max_len);
> #ifdef POSIX_FADV_WILLNEED
> posix_fadvise(s->fd, pos, max_len, POSIX_FADV_DONTNEED);
> posix_fadvise(s->fd, pos + max_len, PREFETCH_LEN, POSIX_FADV_WILLNEED);
> #endif
> 
> should make more sense.

Agreed.

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



More information about the MPlayer-dev-eng mailing list