summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-01-20 16:34:56 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-01-20 16:34:56 +0100
commit9038f45a0d0996043ba79cdd38c4f0c6153f64ba (patch)
tree2932b659156a3c4f26bd144599c3a531a37844d6 /menu.c
parent9e1b89ec5c4c8760014dc8e1109bb16a05b3ec4d (diff)
downloadvdr-9038f45a0d0996043ba79cdd38c4f0c6153f64ba.tar.gz
vdr-9038f45a0d0996043ba79cdd38c4f0c6153f64ba.tar.bz2
Recordings are now only started if there is at least 300MB free disk space
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/menu.c b/menu.c
index dff19098..44c9094d 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.396 2006/01/15 15:02:36 kls Exp $
+ * $Id: menu.c 1.397 2006/01/20 16:28:18 kls Exp $
*/
#include "menu.h"
@@ -36,6 +36,8 @@
#define MAXRECORDCONTROLS (MAXDEVICES * MAXRECEIVERS)
#define MAXINSTANTRECTIME (24 * 60 - 1) // 23:59 hours
#define MAXWAITFORCAMMENU 4 // seconds to wait for the CAM menu to open
+#define MINFREEDISK 300 // minimum free disk space required to start recording
+#define NODISKSPACEDELTA 300 // seconds between "Not enough disk space to start recording!" messages
#define CHNUMWIDTH (numdigits(Channels.MaxNumber()) + 1)
@@ -3520,6 +3522,19 @@ int cRecordControls::state = 0;
bool cRecordControls::Start(cTimer *Timer, bool Pause)
{
+ static time_t LastNoDiskSpaceMessage = 0;
+ int FreeMB = 0;
+ VideoDiskSpace(&FreeMB);
+ if (FreeMB < MINFREEDISK) {
+ if (!Timer || time(NULL) - LastNoDiskSpaceMessage > NODISKSPACEDELTA) {
+ isyslog("not enough disk space to start recording%s%s", Timer ? " timer " : "", Timer ? *Timer->ToDescr() : "");
+ Skins.Message(mtWarning, tr("Not enough disk space to start recording!"));
+ LastNoDiskSpaceMessage = time(NULL);
+ }
+ return false;
+ }
+ LastNoDiskSpaceMessage = 0;
+
ChangeState();
int ch = Timer ? Timer->Channel()->Number() : cDevice::CurrentChannel();
cChannel *channel = Channels.GetByNumber(ch);
@@ -3548,8 +3563,10 @@ bool cRecordControls::Start(cTimer *Timer, bool Pause)
}
}
}
- else if (!Timer || (Timer->Priority() >= Setup.PrimaryLimit && !Timer->Pending()))
+ else if (!Timer || (Timer->Priority() >= Setup.PrimaryLimit && !Timer->Pending())) {
isyslog("no free DVB device to record channel %d!", ch);
+ Skins.Message(mtError, tr("No free DVB device to record!"));
+ }
}
else
esyslog("ERROR: channel %d not defined!", ch);