From ff587ae924b104af87ad951b3042254117d3d1af Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Thu, 1 Nov 2012 17:23:42 +0100 Subject: Reverted pretimer detection changes --- command/markad-standalone.cpp | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) (limited to 'command/markad-standalone.cpp') 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,""); - if (pbstart) { - pbstart+=8; - bstart=atoi(pbstart); - } else { - pbstart=strstr(line,""); - 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); -- cgit v1.2.3