diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-20 15:25:06 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-20 15:25:06 +0100 |
commit | a914aed05adaa0ced56dd1bbafbaf3fb9300c0b0 (patch) | |
tree | f8e90917e7d063d1b57b51b053326f154774798c | |
parent | d7d57c3d2ab37677a397ec8338daf26041439e0f (diff) | |
download | vdr-a914aed05adaa0ced56dd1bbafbaf3fb9300c0b0.tar.gz vdr-a914aed05adaa0ced56dd1bbafbaf3fb9300c0b0.tar.bz2 |
Fixed cUnbufferedFile::Seek() in case it is compiled without USE_FADVISE
-rw-r--r-- | CONTRIBUTORS | 3 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | tools.c | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index b262a1e7..a237c9df 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2672,3 +2672,6 @@ Frank Neumann <frank.neumann@hp.com> Gerald Dachs <vdr@dachsweb.de> for reporting a problem with checking for minimum line length of 21 characters in the LIRC receiver code + +Juergen Lock <vdr-l@jelal.kn-bremen.de> + for fixing cUnbufferedFile::Seek() in case it is compiled without USE_FADVISE @@ -6567,3 +6567,5 @@ Video Disk Recorder Revision History - Made updating the editing marks during replay react faster in case the marks file has just been written. - Fixed horizontal scaling of subtitles (reported by Reinhard Nissl). +- Fixed cUnbufferedFile::Seek() in case it is compiled without USE_FADVISE (thanks + to Juergen Lock). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 2.12 2011/02/25 14:58:31 kls Exp $ + * $Id: tools.c 2.13 2011/03/20 15:20:00 kls Exp $ */ #include "tools.h" @@ -1575,9 +1575,9 @@ ssize_t cUnbufferedFile::Read(void *Data, size_t Size) cachedstart = min(cachedstart, curpos); #endif ssize_t bytesRead = safe_read(fd, Data, Size); -#ifdef USE_FADVISE if (bytesRead > 0) { curpos += bytesRead; +#ifdef USE_FADVISE cachedend = max(cachedend, curpos); // Read ahead: @@ -1597,8 +1597,9 @@ ssize_t cUnbufferedFile::Read(void *Data, size_t Size) } else ahead = curpos; // jumped -> we really don't want any readahead, otherwise e.g. fast-rewind gets in trouble. +#endif } - +#ifdef USE_FADVISE if (cachedstart < cachedend) { if (curpos - cachedstart > READCHUNK * 2) { // current position has moved forward enough, shrink tail window. |