diff options
author | Jochen Dolze <vdr@dolze.de> | 2011-03-13 22:38:04 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2011-03-13 22:38:04 +0100 |
commit | ad13e186a657a6d2488dcc608ef670804107f4a7 (patch) | |
tree | 7b5a34fbce92b5038a4bf3cf1d31374f861568b2 /command/video.cpp | |
parent | a9829b55f99465d6194de0e8e8fb648d24d79317 (diff) | |
download | vdr-plugin-markad-ad13e186a657a6d2488dcc608ef670804107f4a7.tar.gz vdr-plugin-markad-ad13e186a657a6d2488dcc608ef670804107f4a7.tar.bz2 |
Changed order of detection modes in video.cpp
Changed position of start/stop detection
Diffstat (limited to 'command/video.cpp')
-rw-r--r-- | command/video.cpp | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/command/video.cpp b/command/video.cpp index 31d0bdc..9233d9a 100644 --- a/command/video.cpp +++ b/command/video.cpp @@ -110,6 +110,7 @@ int cMarkAdLogo::Load(const char *directory, char *file, int plane) fclose(pFile); return -2; } + fclose(pFile); if (!area.mpixel[plane]) { @@ -126,7 +127,6 @@ int cMarkAdLogo::Load(const char *directory, char *file, int plane) LOGOHEIGHT=height; } - fclose(pFile); area.valid[plane]=true; return 0; } @@ -316,6 +316,7 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) int rpixel=0,mpixel=0; int processed=0; *logoframenumber=-1; + if (area.corner==-1) return LOGO_NOCHANGE; for (int plane=0; plane<4; plane++) { @@ -354,7 +355,8 @@ int cMarkAdLogo::Detect(int framenumber, int *logoframenumber) { area.status=LOGO_INVISIBLE; } - *logoframenumber=area.framenumber; + area.framenumber=framenumber; + *logoframenumber=framenumber; } if (rpixel>=(mpixel*LOGO_VMARK)) @@ -856,27 +858,6 @@ MarkAdMarks *cMarkAdVideo::Process(int FrameNumber, int FrameNumberNext) resetmarks(); - if (!macontext->Video.Options.IgnoreLogoDetection) - { - int logoframenumber; - int lret=logo->Process(FrameNumber,&logoframenumber); - if ((lret>=-1) && (lret!=0) && (logoframenumber!=-1)) - { - if (lret>0) - { - addmark(MT_LOGOSTART,logoframenumber); - } - else - { - addmark(MT_LOGOSTOP,logoframenumber); - } - } - } - else - { - logo->SetStatusUninitialized(); - } - int hborderframenumber; int hret=hborder->Process(FrameNumber,&hborderframenumber); @@ -917,6 +898,28 @@ MarkAdMarks *cMarkAdVideo::Process(int FrameNumber, int FrameNumberNext) aspectratio.Num=macontext->Video.Info.AspectRatio.Num; aspectratio.Den=macontext->Video.Info.AspectRatio.Den; } + + if (!macontext->Video.Options.IgnoreLogoDetection) + { + int logoframenumber; + int lret=logo->Process(FrameNumber,&logoframenumber); + if ((lret>=-1) && (lret!=0) && (logoframenumber!=-1)) + { + if (lret>0) + { + addmark(MT_LOGOSTART,logoframenumber); + } + else + { + addmark(MT_LOGOSTOP,logoframenumber); + } + } + } + else + { + logo->SetStatusUninitialized(); + } + framelast=FrameNumberNext; framebeforelast=FrameNumber; if (marks.Count) |