summaryrefslogtreecommitdiff
path: root/command/markad-standalone.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-11-01 17:23:42 +0100
committerJochen Dolze <vdr@dolze.de>2012-11-01 17:23:42 +0100
commitff587ae924b104af87ad951b3042254117d3d1af (patch)
tree8ee63fa078373d4ae2569ef15ea471df091c08df /command/markad-standalone.cpp
parent7e3a33b48e1a0e1b958324780f6ce61e03acba78 (diff)
downloadvdr-plugin-markad-ff587ae924b104af87ad951b3042254117d3d1af.tar.gz
vdr-plugin-markad-ff587ae924b104af87ad951b3042254117d3d1af.tar.bz2
Reverted pretimer detection changes
Diffstat (limited to 'command/markad-standalone.cpp')
-rw-r--r--command/markad-standalone.cpp43
1 files changed, 7 insertions, 36 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 8385043..633555e 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -820,14 +820,7 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
if (macontext.Video.Info.Pict_Type==MA_I_TYPE)
{
lastiframe=iframe;
- if (macontext.Info.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264)
- {
- iframe=actframe;
- }
- else
- {
- iframe=actframe-1;
- }
+ iframe=actframe-1;
dRes=true;
}
}
@@ -1472,7 +1465,7 @@ bool cMarkAdStandalone::SaveInfo()
return (err==false);
}
-time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int bstart, int fd)
+time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int fd)
{
// get broadcast start from atime of directory (if the volume is mounted with noatime)
struct mntent *ent;
@@ -1504,7 +1497,7 @@ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int bstart, int fd)
if ((useatime) && (stat(directory,&statbuf)!=-1))
{
- if (fabs(difftime(start,statbuf.st_atime))<1800)
+ if (fabs(difftime(start,statbuf.st_atime))<7200)
{
isyslog("getting broadcast start from directory atime");
return statbuf.st_atime;
@@ -1513,16 +1506,14 @@ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int bstart, int fd)
// try to get from mtime
// (and hope info.vdr has not changed after the start of the recording)
- /*
if (fstat(fd,&statbuf)!=-1)
{
- if (fabs(difftime(start,statbuf.st_mtime))<1800)
+ if (fabs(difftime(start,statbuf.st_mtime))<7200)
{
isyslog("getting broadcast start from info mtime");
return (time_t) statbuf.st_mtime;
}
}
- */
// fallback to the directory
const char *timestr=strrchr(directory,'/');
@@ -1541,10 +1532,8 @@ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int bstart, int fd)
t.tm_mon--;
t.tm_sec=0;
t.tm_isdst=-1;
- isyslog("getting broadcast start from directory");
- time_t e=mktime(&t);
- e-=(time_t) bstart;
- return e;
+ isyslog("getting broadcast start from directory (can be wrong!)");
+ return mktime(&t);
}
}
}
@@ -1595,7 +1584,6 @@ bool cMarkAdStandalone::LoadInfo()
char *line=NULL;
size_t linelen;
- int bstart=0;
while (getline(&line,&linelen,f)!=-1)
{
if (line[0]=='C')
@@ -1641,23 +1629,6 @@ bool cMarkAdStandalone::LoadInfo()
if (cr) *cr=0;
}
}
- if (line[0]=='@')
- {
- /* if we have an epgsearch line, we can assume the prestart time */
- char *pbstart=strstr(line,"<bstart>");
- if (pbstart) {
- pbstart+=8;
- bstart=atoi(pbstart);
- } else {
- pbstart=strstr(line,"<start>");
- if (pbstart && startTime) {
- pbstart+=7;
- bstart=atoi(pbstart);
- bstart=startTime-bstart;
- }
- }
- if ((bstart>3600) || (bstart<0)) bstart=0;
- }
if (line[0]=='F')
{
int fps;
@@ -1719,7 +1690,7 @@ bool cMarkAdStandalone::LoadInfo()
if ((length) && (!bIgnoreTimerInfo) && (startTime))
{
- time_t rStart=GetBroadcastStart(startTime,bstart,fileno(f));
+ time_t rStart=GetBroadcastStart(startTime, fileno(f));
if (rStart)
{
tStart=(int) (startTime-rStart);