summaryrefslogtreecommitdiff
path: root/command/markad-standalone.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-10-12 13:57:23 +0200
committerJochen Dolze <vdr@dolze.de>2010-10-12 13:57:23 +0200
commit93dfddbfa472e3521df8b3b2e04e67f849db6e15 (patch)
treef77480f68799946cb2a115ec48215efe6607886f /command/markad-standalone.cpp
parent2994e021ee44eea1c9443da897909c79cef0f963 (diff)
downloadvdr-plugin-markad-93dfddbfa472e3521df8b3b2e04e67f849db6e15.tar.gz
vdr-plugin-markad-93dfddbfa472e3521df8b3b2e04e67f849db6e15.tar.bz2
Changed detection of border/aspect/channel-changes
Diffstat (limited to 'command/markad-standalone.cpp')
-rw-r--r--command/markad-standalone.cpp87
1 files changed, 53 insertions, 34 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 4129f63..ec2f4a0 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -360,7 +360,7 @@ void cMarkAdStandalone::CheckStartStop(int frame, bool checkend)
}
}
-void cMarkAdStandalone::CheckLogoMarks()
+void cMarkAdStandalone::CheckLogoMarks(clMark *last)
{
clMark *mark=marks.GetFirst();
while (mark)
@@ -382,6 +382,7 @@ void cMarkAdStandalone::CheckLogoMarks()
}
}
mark=mark->Next();
+ if ((last) && (mark==last)) return;
}
}
@@ -607,7 +608,8 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
if ((Mark->Position-prev->position)<MARKDIFF)
{
if (Mark->Comment) isyslog("%s",Mark->Comment);
- isyslog("aspectratio change in short distance, deleting this mark (%i)",Mark->Position);
+ isyslog("aspectratio change in short distance, deleting this mark (%i)",
+ Mark->Position);
return;
}
}
@@ -618,7 +620,8 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
if ((Mark->Position-prev->position)<MARKDIFF)
{
if (Mark->Comment) isyslog("%s",Mark->Comment);
- isyslog("audiochannel change in short distance, deleting this mark (%i)",Mark->Position);
+ isyslog("audiochannel change in short distance, deleting this mark (%i)",
+ Mark->Position);
return;
}
}
@@ -627,8 +630,8 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
if (macontext.Info.Length>0)
{
- if (((Mark->Type & 0xF0)==MT_BORDERCHANGE) && (Mark->Position>chkLEFT) &&
- (!macontext.Video.Options.IgnoreLogoDetection))
+ if ((marks.Count(MT_BORDERCHANGE,0xF0)>=3) && (Mark->Position>chkLEFT) &&
+ (Mark->Position<chkRIGHT) && (!macontext.Video.Options.IgnoreLogoDetection))
{
if (Mark->Comment)
{
@@ -641,47 +644,62 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
marks.Del((uchar) MT_LOGOSTOP);
}
- if (((Mark->Type==MT_CHANNELSTART) || (Mark->Type==MT_ASPECTSTART)) &&
- (Mark->Position>chkLEFT) && (Mark->Position<chkRIGHT) && (bDecodeVideo))
+ bool deleteLogoBorder=false;
+ if ((marks.Count(MT_CHANNELCHANGE,0xF0)>=3) && (Mark->Position>chkLEFT) &&
+ (Mark->Position<chkRIGHT) && (!macontext.Video.Options.IgnoreLogoDetection))
{
- if (Mark->Comment)
+ if (!loggedAlready)
{
- isyslog("%s",Mark->Comment);
- loggedAlready=true;
+ if (Mark->Comment)
+ {
+ isyslog("%s",Mark->Comment);
+ loggedAlready=true;
+ }
}
-
- if ((Mark->Type & 0xF0)==MT_CHANNELCHANGE)
+ isyslog("audio channel changes detected. logo/border detection disabled");
+ if (macontext.Info.VPid.Type==MARKAD_PIDTYPE_VIDEO_H262)
{
- isyslog("audio channel changes detected. logo/border detection disabled");
- if (macontext.Info.VPid.Type==MARKAD_PIDTYPE_VIDEO_H262)
+ if (!macontext.Info.AspectRatio.Num)
{
- if (!macontext.Info.AspectRatio.Num)
- {
- isyslog("assuming broadcast aspectratio is 16:9");
- macontext.Info.AspectRatio.Num=16;
- macontext.Info.AspectRatio.Den=9;
- macontext.Video.Options.IgnoreAspectRatio=true;
- }
+ isyslog("assuming broadcast aspectratio is 16:9");
+ macontext.Info.AspectRatio.Num=16;
+ macontext.Info.AspectRatio.Den=9;
+ macontext.Video.Options.IgnoreAspectRatio=true;
}
- macontext.Audio.Info.DolbyDigital51=true;
- setAudio51=true;
- setAudio20=false;
- reprocess=true;
}
- else
- {
- isyslog("aspectratio changes detected. logo/border detection disabled");
+ macontext.Audio.Info.DolbyDigital51=true;
+ setAudio51=true;
+ setAudio20=false;
+ reprocess=true;
+ deleteLogoBorder=true;
+ }
- if ((!macontext.Info.AspectRatio.Num) && ((Mark->Type & 0xF0)==MT_ASPECTCHANGE))
+ if ((marks.Count(MT_ASPECTCHANGE,0xF0)>=3) && (Mark->Position>chkLEFT) &&
+ (Mark->Position<chkRIGHT) && (!macontext.Video.Options.IgnoreLogoDetection))
+ {
+ if (!loggedAlready)
+ {
+ if (Mark->Comment)
{
- isyslog("assuming broadcast aspectratio is 4:3");
- macontext.Info.AspectRatio.Num=4;
- macontext.Info.AspectRatio.Den=3;
- reprocess=true;
- setVideo43=true;
+ isyslog("%s",Mark->Comment);
+ loggedAlready=true;
}
}
+ isyslog("aspectratio changes detected. logo/border detection disabled");
+ if ((!macontext.Info.AspectRatio.Num) && ((Mark->Type & 0xF0)==MT_ASPECTCHANGE))
+ {
+ isyslog("assuming broadcast aspectratio is 4:3");
+ macontext.Info.AspectRatio.Num=4;
+ macontext.Info.AspectRatio.Den=3;
+ reprocess=true;
+ setVideo43=true;
+ }
+ deleteLogoBorder=true;
+ }
+
+ if (deleteLogoBorder)
+ {
bDecodeVideo=false;
macontext.Video.Data.Valid=false;
marks.Del((uchar) MT_LOGOSTART);
@@ -691,6 +709,7 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark)
}
}
if (Mark->Position>chkLEFT) CheckFirstMark();
+ if (marksAligned) CheckLogoMarks(marks.GetLast());
if ((Mark->Comment) && (!loggedAlready)) isyslog("%s",Mark->Comment);
marks.Add(Mark->Type,Mark->Position,Mark->Comment);