mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Recordings are now only started if there is at least 300MB free disk space
This commit is contained in:
parent
9e1b89ec5c
commit
9038f45a0d
@ -1671,3 +1671,6 @@ Franz Gangkofer <Franz.Gangkofer@cadsoft.de>
|
|||||||
|
|
||||||
Malte Schröder <MalteSch@gmx.de>
|
Malte Schröder <MalteSch@gmx.de>
|
||||||
for reporting a crash after executing the SVDRP command CLRE
|
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
|
||||||
|
2
HISTORY
2
HISTORY
@ -4206,3 +4206,5 @@ Video Disk Recorder Revision History
|
|||||||
Rolf Ahrenberg). cEvent::FixEpgBugs() now assigns a "No title" string to events
|
Rolf Ahrenberg). cEvent::FixEpgBugs() now assigns a "No title" string to events
|
||||||
that have no title.
|
that have no title.
|
||||||
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
|
- 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).
|
||||||
|
23
i18n.c
23
i18n.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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:
|
* Translations provided by:
|
||||||
*
|
*
|
||||||
@ -2336,6 +2336,27 @@ const tI18nPhrase Phrases[] = {
|
|||||||
"Väljalülitamine ebaõnnestus - '-s' parameeter puudub!",
|
"Väljalülitamine ebaõnnestus - '-s' parameeter puudub!",
|
||||||
"Kan ikke slukke - parameter '-s' ikke angivet!",
|
"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!",
|
{ "Low disk space!",
|
||||||
"Platte beinahe voll!",
|
"Platte beinahe voll!",
|
||||||
"Premalo prostora na disku!",
|
"Premalo prostora na disku!",
|
||||||
|
21
menu.c
21
menu.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "menu.h"
|
||||||
@ -36,6 +36,8 @@
|
|||||||
#define MAXRECORDCONTROLS (MAXDEVICES * MAXRECEIVERS)
|
#define MAXRECORDCONTROLS (MAXDEVICES * MAXRECEIVERS)
|
||||||
#define MAXINSTANTRECTIME (24 * 60 - 1) // 23:59 hours
|
#define MAXINSTANTRECTIME (24 * 60 - 1) // 23:59 hours
|
||||||
#define MAXWAITFORCAMMENU 4 // seconds to wait for the CAM menu to open
|
#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)
|
#define CHNUMWIDTH (numdigits(Channels.MaxNumber()) + 1)
|
||||||
|
|
||||||
@ -3520,6 +3522,19 @@ int cRecordControls::state = 0;
|
|||||||
|
|
||||||
bool cRecordControls::Start(cTimer *Timer, bool Pause)
|
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();
|
ChangeState();
|
||||||
int ch = Timer ? Timer->Channel()->Number() : cDevice::CurrentChannel();
|
int ch = Timer ? Timer->Channel()->Number() : cDevice::CurrentChannel();
|
||||||
cChannel *channel = Channels.GetByNumber(ch);
|
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);
|
isyslog("no free DVB device to record channel %d!", ch);
|
||||||
|
Skins.Message(mtError, tr("No free DVB device to record!"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
esyslog("ERROR: channel %d not defined!", ch);
|
esyslog("ERROR: channel %d not defined!", ch);
|
||||||
|
6
vdr.c
6
vdr.c
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* The project's page is at http://www.cadsoft.de/vdr
|
* 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>
|
#include <getopt.h>
|
||||||
@ -902,8 +902,6 @@ int main(int argc, char *argv[])
|
|||||||
if (!cControl::Control()) {
|
if (!cControl::Control()) {
|
||||||
if (cRecordControls::Start())
|
if (cRecordControls::Start())
|
||||||
Skins.Message(mtInfo, tr("Recording started"));
|
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
|
key = kNone; // nobody else needs to see this key
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -947,8 +945,6 @@ int main(int argc, char *argv[])
|
|||||||
case osRecord: DELETE_MENU;
|
case osRecord: DELETE_MENU;
|
||||||
if (cRecordControls::Start())
|
if (cRecordControls::Start())
|
||||||
Skins.Message(mtInfo, tr("Recording started"));
|
Skins.Message(mtInfo, tr("Recording started"));
|
||||||
else
|
|
||||||
Skins.Message(mtError, tr("No free DVB device to record!"));
|
|
||||||
break;
|
break;
|
||||||
case osRecordings:
|
case osRecordings:
|
||||||
DELETE_MENU;
|
DELETE_MENU;
|
||||||
|
Loading…
Reference in New Issue
Block a user