Fixed calculating the cache size in cUnbufferedFile::Read()

This commit is contained in:
Klaus Schmidinger 2006-05-26 10:13:48 +02:00
parent 09386e621d
commit af9266d21c
3 changed files with 5 additions and 3 deletions

View File

@ -274,6 +274,7 @@ Artur Skawina <skawina@geocities.com>
for pointing out a problem with the ERR macro defined by ncurses.h
for a patch that contained a fix for checking toFile in cCuttingThread::Action()
for improving cUnbufferedFile
for fixing calculating the cache size in cUnbufferedFile::Read()
Werner Fink <werner@suse.de>
for making I/O more robust by handling EINTR

View File

@ -4716,7 +4716,7 @@ Video Disk Recorder Revision History
- Fixed automatically updating the CAM menu in case the whole operation (for
instance a firmware update) takes longer than the menu timeout.
2006-05-25: Version 1.4.0-2
2006-05-26: Version 1.4.0-2
- Removed leftover LSMOD=... line from 'runvdr'.
- Modified the Makefile to copy additional libraries a plugin might provide (suggested
@ -4734,3 +4734,4 @@ Video Disk Recorder Revision History
- Fixed handling the running status of EPG events in case the "Schedule" menu is
currently open (i.e. a write lock on the schedules data can't be achieved).
- Fixed handling VPS timers in case the EPG event hasn't been 'seen' in a while.
- Fixed calculating the cache size in cUnbufferedFile::Read() (thanks to Artur Skawina).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: tools.c 1.117 2006/04/21 15:12:47 kls Exp $
* $Id: tools.c 1.118 2006/05/26 10:10:31 kls Exp $
*/
#include "tools.h"
@ -1179,7 +1179,7 @@ ssize_t cUnbufferedFile::Read(void *Data, size_t Size)
}
else if (cachedend > ahead && cachedend - curpos > READCHUNK * 2) {
// current position has moved back enough, shrink head window.
FadviseDrop(curpos + READCHUNK, cachedend - curpos + READCHUNK);
FadviseDrop(curpos + READCHUNK, cachedend - (curpos + READCHUNK));
cachedend = curpos + READCHUNK;
}
}