summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--command/markad-standalone.cpp23
-rw-r--r--plugin/markad.cpp9
-rw-r--r--plugin/markad.h1
-rw-r--r--plugin/po/de_DE.po5
-rw-r--r--plugin/po/es_ES.po5
-rw-r--r--plugin/po/it_IT.po6
-rw-r--r--plugin/setup.cpp4
-rw-r--r--plugin/setup.h2
-rw-r--r--plugin/status.cpp18
-rw-r--r--plugin/status.h1
10 files changed, 42 insertions, 32 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 51e4950..f99ae92 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -1368,23 +1368,36 @@ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int fd)
struct mntent *ent;
struct stat statbuf;
FILE *mounts=setmntent(_PATH_MOUNTED,"r");
+ int mlen=0;
+ int oldmlen=0;
+ bool useatime=false;
while ((ent=getmntent(mounts))!=NULL)
{
if (strstr(directory,ent->mnt_dir))
{
- if (strstr(ent->mnt_opts,"noatime"))
+ mlen=strlen(ent->mnt_dir);
+ if (mlen>oldmlen)
{
- if (stat(directory,&statbuf)!=-1)
+ if (strstr(ent->mnt_opts,"noatime"))
{
- endmntent(mounts);
- isyslog("getting broadcast start from directory atime");
- return statbuf.st_atime;
+ useatime=true;
+ }
+ else
+ {
+ useatime=false;
}
}
+ oldmlen=mlen;
}
}
endmntent(mounts);
+ if ((useatime) && (stat(directory,&statbuf)!=-1))
+ {
+ isyslog("getting broadcast start from directory atime");
+ return statbuf.st_atime;
+ }
+
// try to get from mtime
// (and hope info.vdr has not changed after the start of the recording)
if (fstat(fd,&statbuf)!=-1)
diff --git a/plugin/markad.cpp b/plugin/markad.cpp
index cd4594c..7dc97d1 100644
--- a/plugin/markad.cpp
+++ b/plugin/markad.cpp
@@ -32,7 +32,6 @@ cPluginMarkAd::cPluginMarkAd(void)
setup.whileReplaying=true;
setup.GenIndex=false;
setup.OSDMessage=false;
- setup.BackupMarks=false;
setup.Verbose=false;
setup.NoMargins=false;
setup.HideMainMenuEntry=false;
@@ -129,6 +128,7 @@ bool cPluginMarkAd::Initialize(void)
bool cPluginMarkAd::Start(void)
{
// Start any background activities the plugin shall perform.
+ lastcheck=0;
setup.PluginName=Name();
setup.LogoDir=logodir;
statusMonitor = new cStatusMarkAd(bindir,logodir,&setup);
@@ -149,6 +149,12 @@ void cPluginMarkAd::MainThreadHook(void)
{
// Perform actions in the context of the main program thread.
// WARNING: Use with great care - see PLUGINS.html!
+ time_t now=time(NULL);
+ if (now>(lastcheck+5))
+ {
+ statusMonitor->Check();
+ lastcheck=now;
+ }
}
cString cPluginMarkAd::Active(void)
@@ -184,7 +190,6 @@ bool cPluginMarkAd::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name,"whileRecording")) setup.whileRecording=atoi(Value);
else if (!strcasecmp(Name,"whileReplaying")) setup.whileReplaying=atoi(Value);
else if (!strcasecmp(Name,"OSDMessage")) setup.OSDMessage=atoi(Value);
- else if (!strcasecmp(Name,"BackupMarks")) setup.BackupMarks=atoi(Value);
else if (!strcasecmp(Name,"GenIndex")) setup.GenIndex=atoi(Value);
else if (!strcasecmp(Name,"Verbose")) setup.Verbose=atoi(Value);
else if (!strcasecmp(Name,"IgnoreMargins")) setup.NoMargins=atoi(Value);
diff --git a/plugin/markad.h b/plugin/markad.h
index 241c18d..27652b9 100644
--- a/plugin/markad.h
+++ b/plugin/markad.h
@@ -25,6 +25,7 @@ private:
char *logodir;
struct setup setup;
char title[80];
+ time_t lastcheck;
bool ReadTitle(const char *Directory);
public:
cPluginMarkAd(void);
diff --git a/plugin/po/de_DE.po b/plugin/po/de_DE.po
index 41e9040..ceb144c 100644
--- a/plugin/po/de_DE.po
+++ b/plugin/po/de_DE.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2011-02-21 22:13+0100\n"
+"POT-Creation-Date: 2011-02-22 21:59+0100\n"
"PO-Revision-Date: 2009-08-27 14:18+0200\n"
"Last-Translator: Jochen Dolze <vdr@dolze.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -81,9 +81,6 @@ msgstr "Infodatei korrigieren"
msgid "OSD message"
msgstr "OSD Meldung"
-msgid "backup marks"
-msgstr "alte Marken sichern"
-
msgid "verbose logging"
msgstr "ausführliches Logging"
diff --git a/plugin/po/es_ES.po b/plugin/po/es_ES.po
index 7f84da2..9eee574 100644
--- a/plugin/po/es_ES.po
+++ b/plugin/po/es_ES.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2011-02-21 22:13+0100\n"
+"POT-Creation-Date: 2011-02-22 21:59+0100\n"
"PO-Revision-Date: 2011-02-12 11:30+0100\n"
"Last-Translator: Javier Bradineras <jbradi@hotmail.com>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -84,9 +84,6 @@ msgstr "Corrige fichero de información"
msgid "OSD message"
msgstr "Mensaje OSD"
-msgid "backup marks"
-msgstr "Hacer copia de seguridad de las marcas"
-
msgid "verbose logging"
msgstr "Log detallado"
diff --git a/plugin/po/it_IT.po b/plugin/po/it_IT.po
index 4876f65..6e5c26c 100644
--- a/plugin/po/it_IT.po
+++ b/plugin/po/it_IT.po
@@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2011-02-21 22:13+0100\n"
+"POT-Creation-Date: 2011-02-22 21:59+0100\n"
"PO-Revision-Date: 2010-08-09 20:05+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -84,9 +84,6 @@ msgstr ""
msgid "OSD message"
msgstr "Messaggio OSD"
-msgid "backup marks"
-msgstr "Salva marcatori"
-
msgid "verbose logging"
msgstr "Log dettagliato"
@@ -107,3 +104,4 @@ msgstr ""
msgid "Mark advertisements"
msgstr "Segna i marcatori della pubblicitá"
+
diff --git a/plugin/setup.cpp b/plugin/setup.cpp
index e9f1eda..4709afe 100644
--- a/plugin/setup.cpp
+++ b/plugin/setup.cpp
@@ -15,7 +15,6 @@ cSetupMarkAd::cSetupMarkAd(struct setup *Setup)
whilerecording=setup->whileRecording;
whilereplaying=setup->whileReplaying;
osdmsg=setup->OSDMessage;
- backupmarks=setup->BackupMarks;
verbose=setup->Verbose;
genindex=setup->GenIndex;
nomargins=setup->NoMargins;
@@ -52,7 +51,6 @@ void cSetupMarkAd::write(void)
Add(new cMenuEditBoolItem(tr("repair index, if broken"),&genindex));
Add(new cMenuEditBoolItem(tr("correct info file"),&saveinfo));
Add(new cMenuEditBoolItem(tr("OSD message"),&osdmsg));
- Add(new cMenuEditBoolItem(tr("backup marks"),&backupmarks));
Add(new cMenuEditBoolItem(tr("verbose logging"),&verbose));
Add(new cMenuEditBoolItem(tr("log to recording directory"),&log2rec));
Add(new cMenuEditBoolItem(tr("hide mainmenu entry"),&hidemainmenuentry));
@@ -112,7 +110,6 @@ void cSetupMarkAd::Store(void)
SetupStore("whileRecording",whilerecording);
SetupStore("whileReplaying",whilereplaying);
SetupStore("IgnoreMargins",nomargins);
- SetupStore("BackupMarks",backupmarks);
SetupStore("GenIndex",genindex);
SetupStore("SecondPass",secondpass);
SetupStore("OSDMessage",osdmsg);
@@ -128,7 +125,6 @@ void cSetupMarkAd::Store(void)
setup->OSDMessage=(bool) osdmsg;
setup->GenIndex=(bool) genindex;
setup->SecondPass=(bool) secondpass;
- setup->BackupMarks=(bool) backupmarks;
setup->Verbose=(bool) verbose;
setup->NoMargins=(bool) nomargins;
setup->HideMainMenuEntry=(bool) hidemainmenuentry;
diff --git a/plugin/setup.h b/plugin/setup.h
index 1529ab3..92bfb53 100644
--- a/plugin/setup.h
+++ b/plugin/setup.h
@@ -15,7 +15,6 @@ struct setup
bool whileRecording;
bool whileReplaying;
bool OSDMessage;
- bool BackupMarks;
bool Verbose;
bool GenIndex;
bool NoMargins;
@@ -37,7 +36,6 @@ private:
int whilerecording;
int whilereplaying;
int osdmsg;
- int backupmarks;
int verbose;
int genindex;
int nomargins;
diff --git a/plugin/status.cpp b/plugin/status.cpp
index 4784a17..c43fbff 100644
--- a/plugin/status.cpp
+++ b/plugin/status.cpp
@@ -70,11 +70,9 @@ void cStatusMarkAd::Replaying(const cControl *UNUSED(Control), const char *UNUSE
bool cStatusMarkAd::Start(const char *FileName, const char *Name, const bool Direct)
{
if ((Direct) && (Get(FileName)!=-1)) return false;
-
- cString cmd = cString::sprintf("\"%s\"/markad %s%s%s%s%s%s%s%s -l \"%s\" %s \"%s\"",
+ cString cmd = cString::sprintf("\"%s\"/markad %s%s%s%s%s%s%s -l \"%s\" %s \"%s\"",
bindir,
setup->Verbose ? " -v " : "",
- setup->BackupMarks ? " -B " : "",
setup->SaveInfo ? " -I " : "",
setup->GenIndex ? " -G " : "",
setup->OSDMessage ? " -O " : "",
@@ -124,7 +122,6 @@ bool cStatusMarkAd::Start(const char *FileName, const char *Name, const bool Dir
void cStatusMarkAd::TimerChange(const cTimer *Timer, eTimerChange Change)
{
if (!Timer) return;
- isyslog("markad: timer changed to %i now=%li StopTime()=%li",Change,time(NULL),Timer->StopTime());
if (Change!=tcDel) return;
if (time(NULL)>=Timer->StopTime()) return; // don't react on normal VDR timer deletion after recording
Remove(Timer->File(),true);
@@ -283,7 +280,7 @@ bool cStatusMarkAd::GetNextActive(struct recs **RecEntry)
if (!RecEntry) return false;
*RecEntry=NULL;
- if (actpos>=(MAXDEVICES*MAXRECEIVERS)) return true;
+ if (actpos>=(MAXDEVICES*MAXRECEIVERS)) return false;
do
{
@@ -292,14 +289,21 @@ bool cStatusMarkAd::GetNextActive(struct recs **RecEntry)
if (getStatus(actpos))
{
*RecEntry=&recs[actpos++];
- break;
+ return true;
}
}
actpos++;
}
while (actpos<(MAXDEVICES*MAXRECEIVERS));
- return true;
+ return false;
+}
+
+void cStatusMarkAd::Check()
+{
+ struct recs *tmpRecs=NULL;
+ ResetActPos();
+ while (GetNextActive(&tmpRecs)) ;
}
bool cStatusMarkAd::MarkAdRunning()
diff --git a/plugin/status.h b/plugin/status.h
index 3f0f5a5..1989a33 100644
--- a/plugin/status.h
+++ b/plugin/status.h
@@ -60,6 +60,7 @@ public:
{
actpos=0;
}
+ void Check(void);
bool GetNextActive(struct recs **RecEntry);
bool Start(const char *FileName, const char *Name, const bool Direct=false);
};