summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-02-08 18:46:19 +0100
committerJochen Dolze <vdr@dolze.de>2011-02-08 18:46:19 +0100
commit44d861cb39b59700ea5b8bd79da088d0d5400a23 (patch)
treed69bdc6f3f147480a35efffbb6a77b4cc1665448
parentd426c3c5d7b064b1568d0f73fd930ba97e88822a (diff)
downloadvdr-plugin-markad-44d861cb39b59700ea5b8bd79da088d0d5400a23.tar.gz
vdr-plugin-markad-44d861cb39b59700ea5b8bd79da088d0d5400a23.tar.bz2
Prevent overlap detection to detect former overlaps in ad block
-rw-r--r--command/markad-standalone.cpp2
-rw-r--r--command/video.cpp10
-rw-r--r--command/video.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 577fd78..f7abde9 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -691,7 +691,7 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
{
if ((actframe-iframe)<=3)
{
- if (pn>mSTART) pos=video->Process2ndPass(lastiframe,Frames,(pn==mBEFORE));
+ if (pn>mSTART) pos=video->ProcessOverlap(lastiframe,Frames,(pn==mBEFORE));
//SaveFrame(lastiframe);
framecounter++;
}
diff --git a/command/video.cpp b/command/video.cpp
index d896847..6f7081b 100644
--- a/command/video.cpp
+++ b/command/video.cpp
@@ -675,8 +675,12 @@ MarkAdPos *cMarkAdOverlap::Detect()
if (simcnt>similarMaxCnt)
{
- result.FrameNumberBefore=histbuf[OV_BEFORE][tmpB].framenumber;
- result.FrameNumberAfter=histbuf[OV_AFTER][tmpA].framenumber;
+ if ((histbuf[OV_BEFORE][tmpB].framenumber>result.FrameNumberBefore) &&
+ (histbuf[OV_AFTER][tmpA].framenumber>result.FrameNumberAfter))
+ {
+ result.FrameNumberBefore=histbuf[OV_BEFORE][tmpB].framenumber;
+ result.FrameNumberAfter=histbuf[OV_AFTER][tmpA].framenumber;
+ }
}
else
{
@@ -827,7 +831,7 @@ bool cMarkAdVideo::aspectratiochange(MarkAdAspectRatio &a, MarkAdAspectRatio &b,
}
-MarkAdPos *cMarkAdVideo::Process2ndPass(int FrameNumber, int Frames, bool BeforeAd)
+MarkAdPos *cMarkAdVideo::ProcessOverlap(int FrameNumber, int Frames, bool BeforeAd)
{
if (!FrameNumber) return NULL;
if (!overlap) overlap=new cMarkAdOverlap(macontext);
diff --git a/command/video.h b/command/video.h
index bee7d29..447d3ec 100644
--- a/command/video.h
+++ b/command/video.h
@@ -176,7 +176,7 @@ private:
public:
cMarkAdVideo(MarkAdContext *maContext);
~cMarkAdVideo();
- MarkAdPos *Process2ndPass(int FrameNumber, int Frames, bool BeforeAd);
+ MarkAdPos *ProcessOverlap(int FrameNumber, int Frames, bool BeforeAd);
MarkAdMarks *Process(int FrameNumber, int FrameNumberNext);
void Clear();
};