diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-20 17:19:46 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-20 17:19:46 +0100 |
commit | 611656bf46a59d8422adfcd158e4bc6dbc688dbd (patch) | |
tree | 2a06a3c8b5ef8fd07bdc93123e92abbcaf78642e | |
parent | 9038f45a0d0996043ba79cdd38c4f0c6153f64ba (diff) | |
download | vdr-611656bf46a59d8422adfcd158e4bc6dbc688dbd.tar.gz vdr-611656bf46a59d8422adfcd158e4bc6dbc688dbd.tar.bz2 |
Added AssertFreeDiskSpace() before starting a timer recording
-rw-r--r-- | menu.c | 4 | ||||
-rw-r--r-- | recording.c | 6 | ||||
-rw-r--r-- | recording.h | 6 |
3 files changed, 10 insertions, 6 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.397 2006/01/20 16:28:18 kls Exp $ + * $Id: menu.c 1.398 2006/01/20 17:19:46 kls Exp $ */ #include "menu.h" @@ -3524,6 +3524,8 @@ bool cRecordControls::Start(cTimer *Timer, bool Pause) { static time_t LastNoDiskSpaceMessage = 0; int FreeMB = 0; + if (Timer) + AssertFreeDiskSpace(Timer->Priority(), true); VideoDiskSpace(&FreeMB); if (FreeMB < MINFREEDISK) { if (!Timer || time(NULL) - LastNoDiskSpaceMessage > NODISKSPACEDELTA) { diff --git a/recording.c b/recording.c index 0f704afc..5c57e187 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.132 2006/01/08 11:40:13 kls Exp $ + * $Id: recording.c 1.133 2006/01/20 17:18:59 kls Exp $ */ #include "recording.h" @@ -117,7 +117,7 @@ void RemoveDeletedRecordings(void) } } -void AssertFreeDiskSpace(int Priority) +void AssertFreeDiskSpace(int Priority, bool Force) { static cMutex Mutex; cMutexLock MutexLock(&Mutex); @@ -126,7 +126,7 @@ void AssertFreeDiskSpace(int Priority) // it will get removed during the next call. static time_t LastFreeDiskCheck = 0; int Factor = (Priority == -1) ? 10 : 1; - if (time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA / Factor) { + if (Force || time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA / Factor) { if (!VideoFileSpaceAvailable(MINDISKSPACE)) { // Make sure only one instance of VDR does this: cLockFile LockFile(VideoDirectory); diff --git a/recording.h b/recording.h index d79b6b4d..7eaddcc3 100644 --- a/recording.h +++ b/recording.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.h 1.48 2005/12/18 11:26:51 kls Exp $ + * $Id: recording.h 1.49 2006/01/20 17:18:28 kls Exp $ */ #ifndef __RECORDING_H @@ -21,9 +21,11 @@ extern bool VfatFileSystem; void RemoveDeletedRecordings(void); -void AssertFreeDiskSpace(int Priority = 0); +void AssertFreeDiskSpace(int Priority = 0, bool Force = false); ///< The special Priority value -1 means that we shall get rid of any ///< deleted recordings faster than normal (because we're cutting). + ///< If Force is true, the check will be done even if the timeout + ///< hasn't expired yet. class cResumeFile { private: |