Commit Message
Am Samstag, 21. Januar 2006 11:05 schrieb Klaus Schmidinger:
> Klaus Schmidinger wrote:
> >>> After some more thinking I believe cRecordControls::Start() actually
> >>> is the better place for this check, since it is called several times.
> >>>
> >>> Please try the attached patch.
Hi Klaus,
because vdr wants to record out of EPG,
I added Timer->ClearFlags(tfActive);
regards Markus
Comments
Markus Hahn wrote:
> Am Samstag, 21. Januar 2006 11:05 schrieb Klaus Schmidinger:
>
>>Klaus Schmidinger wrote:
>>
>>>>>After some more thinking I believe cRecordControls::Start() actually
>>>>>is the better place for this check, since it is called several times.
>>>>>
>>>>>Please try the attached patch.
>
>
> Hi Klaus,
> because vdr wants to record out of EPG,
What do you mean by "vdr wants to record out of EPG"?
> I added Timer->ClearFlags(tfActive);
I don't think it's a good idea to deactivate a timer.
If this is a repeating timer and the user doesn't realize
that it has been deactivated, it won't record next time.
> ------------------------------------------------------------------------
>
> diff -x '[A-Z]*' -x '*.bak' -Nu /home/markus/svn-vdr/vdr-current/i18n.c vdr-rbox/i18n.c
> --- /home/markus/svn-vdr/vdr-current/i18n.c 2006-01-12 18:12:18.000000000 +0100
> +++ vdr-rbox/i18n.c 2006-01-24 18:31:33.000000000 +0100
> ...
Your diff doesn't seem to be made against the latest VDR 1.3.40.
It also contained several test outputs.
Klaus
Am Mittwoch, 25. Januar 2006 17:14 schrieb Klaus Schmidinger:
> Markus Hahn wrote:
>>Klaus Schmidinger wrote:
>>>>>After some more thinking I believe cRecordControls::Start() actually
>>>>>is the better place for this check, since it is called several times.
>>>>>
>>>>>Please try the attached patch.
>
> Hi Klaus,
> because vdr wants to record out of EPG,
> What do you mean by "vdr wants to record out of EPG"?
call up EPG -> OK on running programm -> kRed ->kOk
will set an instant timer.
Few minutes later you will get the message
Skins.Message(mtWarning, tr("Not enough disk space to start recording!")
or
"Low disk space!"
endlessly.
This is caused by cRecordControl::Process();
regards Markus
> >
> > diff -x '[A-Z]*' -x '*.bak' -Nu /home/markus/svn-vdr/vdr-current/i18n.c
> > vdr-rbox/i18n.c --- /home/markus/svn-vdr/vdr-current/i18n.c 2006-01-12
> > 18:12:18.000000000 +0100 +++ vdr-rbox/i18n.c 2006-01-24
> > 18:31:33.000000000 +0100
> > ...
>
> Your diff doesn't seem to be made against the latest VDR 1.3.40.
> It also contained several test outputs.
>
> Klaus
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Markus Hahn wrote:
> Am Mittwoch, 25. Januar 2006 17:14 schrieb Klaus Schmidinger:
>
>>Markus Hahn wrote:
>>
>>>Klaus Schmidinger wrote:
>>>
>>>>>>After some more thinking I believe cRecordControls::Start() actually
>>>>>>is the better place for this check, since it is called several times.
>>>>>>
>>>>>>Please try the attached patch.
>>
>>Hi Klaus,
>>because vdr wants to record out of EPG,
>
>
>>What do you mean by "vdr wants to record out of EPG"?
>
>
> call up EPG -> OK on running programm -> kRed ->kOk
> will set an instant timer.
> Few minutes later you will get the message
> Skins.Message(mtWarning, tr("Not enough disk space to start recording!")
> or
> "Low disk space!"
> endlessly.
>
> This is caused by cRecordControl::Process();
When I simulate a full disk by doing
VideoDiskSpace(&FreeMB);
FreeMB = 0;//XXX
if (FreeMB < MINFREEDISK) {
in cRecordControls::Start(), then go into the EPG and program a timer
as you suggested, I immediately get the message
Not enough disk space to start recording...
and no recording is started. This message is repeated every five minutes,
which I guess is ok since if there actually is somebody watching TV at
that time, they probably want to do something about this. You could
increase NODISKSPACEDELTA if you want this message to be displayed less
often.
If there is enough free disk space at the time the timer is programmed,
the recording will start and once the free disk space falls below
MINDISKSPACE the message
Low disk space!
will be displayed every DISKCHECKDELTA (100) seconds to make the user
aware of the fact that the disk is running full.
Since there are reasonable timeouts between these messages, I'm afraid
I don't see the actual problem. Maybe I didn't have the exact test
case you are running?
Klaus
On Sat, Jan 28, 2006 at 02:23:32PM +0100, Klaus Schmidinger wrote:
> Since there are reasonable timeouts between these messages, I'm afraid
> I don't see the actual problem. Maybe I didn't have the exact test
> case you are running?
Imagine some PVR boxes just used for watching live-TV... There's no hard disk
installed. So the repeating message may be a bit annoying ;-)
Georg Acher wrote:
> On Sat, Jan 28, 2006 at 02:23:32PM +0100, Klaus Schmidinger wrote:
>
>
>>Since there are reasonable timeouts between these messages, I'm afraid
>>I don't see the actual problem. Maybe I didn't have the exact test
>>case you are running?
>
>
> Imagine some PVR boxes just used for watching live-TV... There's no hard disk
> installed. So the repeating message may be a bit annoying ;-)
Well, in that case the whole timer/recording feature should
probably be disabled altogether, shouldn't it?
But then again, who would want a PVR without a hard disk ;-)
Klaus
@@ -2253,7 +2253,7 @@
"Kan ikke slukke - parameter '-s' ikke angivet!",
},
{ "Low disk space!",
- "Platte beinahe voll!",
+ "Kein Speicherplatz",
"Premalo prostora na disku!",
"Spazio su disco insufficiente!",
"Disk bijna vol!",
Gemeinsame Unterverzeichnisse: /home/markus/svn-vdr/vdr-current/libsi und vdr-rbox/libsi.
@@ -46,6 +46,8 @@
#define MAXWAITFORCAMMENU 4 // seconds to wait for the CAM menu to open
#define CHNUMWIDTH (numdigits(Channels.MaxNumber()) + 1)
+#define MINFREEDISK 300 // minimum free disk space required to start recording
+#define NODISKSPACEDELTA 300 // seconds between "Not enough disk space to start recording!" messages
cOsdObject *SetupPluginOsdObject = NULL;
// --- cMenuEditCaItem -------------------------------------------------------
@@ -754,7 +756,8 @@
if (memcmp(timer, &data, sizeof(data)) != 0) {
*timer = data;
if (timer->HasFlags(tfActive))
- timer->ClrFlags(~tfAll); // allows external programs to mark active timers with values > 0xFFFF and recognize if the user has modified them
+ timer->ClrFlags(~tfAll); // allows external programs to mark active timers
+ // with values > 0xFFFF and recognize if the user has modified them
}
if (addIfConfirmed)
Timers.Add(timer);
@@ -4166,7 +4169,18 @@
{
if (!recorder || !timer || !timer->Matches(t))
return false;
+
AssertFreeDiskSpace(timer->Priority());
+
+ int FreeMB = 0;
+ VideoDiskSpace(&FreeMB);
+ if (FreeMB < MINFREEDISK) {
+ timer->ClrFlags(tfActive);
+ Timers.SetModified();
+ Skins.Message(mtWarning, tr("Not enough disk space to start recording!"));
+ return false;
+ }
+
return true;
}
@@ -4176,6 +4190,25 @@
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) {
+ Timer->ClrFlags(tfActive);
+ Timers.SetModified();
+ 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;
int ch = Timer ? Timer->Channel()->Number() : cDevice::CurrentChannel();
cChannel *channel = Channels.GetByNumber(ch);
@@ -4203,9 +4236,11 @@
}
}
}
- 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);
return false;
@@ -4300,7 +4335,7 @@
{
for (int i = 0; i < MAXRECORDCONTROLS; i++) {
if (RecordControls[i]) {
- if (!RecordControls[i]->Process(t))
+ if (!RecordControls[i]->Process(t))
DELETENULL(RecordControls[i]);
}
}
@@ -99,14 +99,14 @@
}
}
-void AssertFreeDiskSpace(int Priority)
+void AssertFreeDiskSpace(int Priority, bool Force)
{
// With every call to this function we try to actually remove
// a file, or mark a file for removal ("delete" it), so that
// 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);
@@ -161,6 +161,7 @@
}
// Unable to free disk space, but there's nothing we can do about that...
isyslog("...no old recording found, giving up");
+ printf("AssertFreeDiskSpace failed \n");
Interface->Confirm(tr("Low disk space!"), 30);
}
LastFreeDiskCheck = time(NULL);
Dateien /home/markus/svn-vdr/vdr-current/.recording.c.swp und vdr-rbox/.recording.c.swp sind verschieden.
@@ -21,7 +21,7 @@
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).
Gemeinsame Unterverzeichnisse: /home/markus/svn-vdr/vdr-current/.svn und vdr-rbox/.svn.
Gemeinsame Unterverzeichnisse: /home/markus/svn-vdr/vdr-current/symbols und vdr-rbox/symbols.
@@ -25,8 +25,10 @@
startTime = stopTime = 0;
recording = pending = inVpsMargin = false;
flags = tfNone;
- if (Instant)
+ if (Instant) {
SetFlags(tfActive | tfInstant);
+ printf("SetFlags %d\n",Flags());
+ }
channel = Channels.GetByNumber(cDevice::CurrentChannel());
time_t t = time(NULL);
struct tm tm_r;
Dateien /home/markus/svn-vdr/vdr-current/.timers.c.swp und vdr-rbox/.timers.c.swp sind verschieden.
@@ -691,6 +691,8 @@
time_t Now = time(NULL);
// Process ongoing recordings:
cRecordControls::Process(Now);
+ //printf("vdr.c: Hier ist der Fehler %d\n",__LINE__);
+
// Start new recordings:
cTimer *Timer = Timers.GetMatch(Now);
if (Timer) {
@@ -866,8 +868,9 @@
DELETENULL(Menu);
active_function = osUnknown;
Temp = NULL;
- if (!cRecordControls::PauseLiveVideo())
- Skins.Message(mtError, tr("No free DVB device to record!"));
+ cRecordControls::PauseLiveVideo();
+ //if (!cRecordControls::PauseLiveVideo())
+ // Skins.Message(mtError, tr("No free DVB device to record!"));
key = kNone; // nobody else needs to see this key
}
break;
@@ -876,9 +879,9 @@
if (!cControl::Control()) {
if (cRecordControls::Start())
Skins.Message(mtInfo, tr("Recording"));
- else
- Skins.Message(mtError, tr("Already recording"));
- key = kNone; // nobody else needs to see this key
+ //else
+ // Skins.Message(mtError, tr("Already recording"));
+ key = kNone; // nobody else needs to see this key
}
break;
// Power off:
@@ -920,9 +923,9 @@
active_function = osUnknown;
Temp = NULL;
if (cRecordControls::Start())
- ;//XXX Skins.Message(mtInfo, tr("Recording"));
- else
- Skins.Message(mtError, tr("No free DVB device to record!"));
+ Skins.Message(mtInfo, tr("Recording started"));
+ // else
+ // Skins.Message(mtError, tr("No free DVB device to record!"));
break;
case osRecordings:
DELETENULL(Menu);