summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS3
-rw-r--r--HISTORY2
-rw-r--r--i18n.c23
-rw-r--r--menu.c21
-rw-r--r--vdr.c6
5 files changed, 47 insertions, 8 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 546ca09d..5ac68c81 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1671,3 +1671,6 @@ Franz Gangkofer <Franz.Gangkofer@cadsoft.de>
Malte Schröder <MalteSch@gmx.de>
for reporting a crash after executing the SVDRP command CLRE
+
+Markus Hahn <mhahn@reel-multimedia.com>
+ for suggesting to only start recordings if there is at least 300MB free disk space
diff --git a/HISTORY b/HISTORY
index 9ac00c5e..3e11c0c5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4206,3 +4206,5 @@ Video Disk Recorder Revision History
Rolf Ahrenberg). cEvent::FixEpgBugs() now assigns a "No title" string to events
that have no title.
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
+- Recordings are now only started if there is at least 300MB free disk space
+ (suggested by Markus Hahn).
diff --git a/i18n.c b/i18n.c
index fea9038a..d976f7ca 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.237 2006/01/20 14:33:39 kls Exp $
+ * $Id: i18n.c 1.238 2006/01/20 16:30:00 kls Exp $
*
* Translations provided by:
*
@@ -2336,6 +2336,27 @@ const tI18nPhrase Phrases[] = {
"Väljalülitamine ebaõnnestus - '-s' parameeter puudub!",
"Kan ikke slukke - parameter '-s' ikke angivet!",
},
+ { "Not enough disk space to start recording!",
+ "Nicht genügend Plattenplatz für Aufnahme!",
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ "",//TODO
+ },
{ "Low disk space!",
"Platte beinahe voll!",
"Premalo prostora na disku!",
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);
diff --git a/vdr.c b/vdr.c
index c1b7e812..c96a3221 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.241 2006/01/16 17:05:49 kls Exp $
+ * $Id: vdr.c 1.242 2006/01/20 16:12:39 kls Exp $
*/
#include <getopt.h>
@@ -902,8 +902,6 @@ int main(int argc, char *argv[])
if (!cControl::Control()) {
if (cRecordControls::Start())
Skins.Message(mtInfo, tr("Recording started"));
- else
- Skins.Message(mtError, tr("No free DVB device to record!"));
key = kNone; // nobody else needs to see this key
}
break;
@@ -947,8 +945,6 @@ int main(int argc, char *argv[])
case osRecord: DELETE_MENU;
if (cRecordControls::Start())
Skins.Message(mtInfo, tr("Recording started"));
- else
- Skins.Message(mtError, tr("No free DVB device to record!"));
break;
case osRecordings:
DELETE_MENU;