summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-03-16 10:26:00 (GMT)
committerJochen Dolze <vdr@dolze.de>2010-03-16 10:26:00 (GMT)
commit6d7569aec72f444763474efb420ae403f90e36ae (patch)
tree4c9b792bfe0c0b54bda1f2e7a2245496982104bd
parentc0712181cc47bd4ae2b082973635dc51880eebe8 (diff)
downloadvdr-plugin-markad-6d7569aec72f444763474efb420ae403f90e36ae.tar.gz
vdr-plugin-markad-6d7569aec72f444763474efb420ae403f90e36ae.tar.bz2
Fixed I-Frame off by one bug in H262, fixed output of H264 progressive marksrelease/v0.0.6
Changed LoadInfo handling
-rw-r--r--markad-standalone.cpp45
-rw-r--r--streaminfo.cpp10
-rw-r--r--streaminfo.h1
3 files changed, 26 insertions, 30 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 9dc0e45..95a6bf4 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -156,13 +156,13 @@ bool cMarkAdStandalone::ProcessFile(const char *Directory, int Number)
{
if (macontext.Video.Info.Pict_Type==MA_I_TYPE)
{
- if ((macontext.General.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264) || (!bDecodeVideo))
+ if (!isTS)
{
- lastiframe=framecnt-1;
+ lastiframe=framecnt-2;
}
else
{
- lastiframe=framecnt-2;
+ lastiframe=framecnt-1;
}
//SaveFrame(lastiframe); // TODO: JUST FOR DEBUGGING!
mark=video->Process(lastiframe);
@@ -346,22 +346,11 @@ bool cMarkAdStandalone::LoadInfo(const char *Directory)
{
if ((stream==1) && (!bIgnoreVideoInfo))
{
- if ((type==1) || (type==5))
- {
- // we have 4:3 SD, ads are today (in Germany) in 16:9
- // so disable video decoding
- if (bDecodeVideo)
- {
- bDecodeVideo=false;
- isyslog("markad [%i]: broadcasts aspectratio is 4:3, disabling video decoding",recvnumber);
- }
- }
- else
+ if ((type!=1) && (type!=5))
{
// we dont have 4:3, so ignore AspectRatio-Changes
macontext.Video.Options.IgnoreAspectRatio=true;
isyslog("markad [%i]: broadcasts aspectratio is not 4:3, disabling aspect ratio",recvnumber);
-
}
}
@@ -369,15 +358,19 @@ bool cMarkAdStandalone::LoadInfo(const char *Directory)
{
if (type==5)
{
- // ok, here we have a problem: 5 means DolbyDigital 2.0 and DolbyDigital 5.1!
- bool bSet=true;
- if (strchr(descr,'2')) bSet=false; // that is really weak!
- if ((bSet) && (bDecodeVideo))
+ // if we have DolbyDigital 2.0 disable AC3
+ if (strchr(descr,'2'))
+ {
+ macontext.General.DPid.Num=0;
+ isyslog("markad [%i]: broadcast with DolbyDigital2.0, disabling AC3 decoding",recvnumber);
+ }
+ // if we have DolbyDigital 5.1 disable video decoding
+ if (strchr(descr,'5'))
{
bDecodeVideo=false;
- macontext.Video.Options.IgnoreAspectRatio=true;
- isyslog("markad [%i]: broadcast with DolbyDigital, disabling video decoding",recvnumber);
+ isyslog("markad [%i]: broadcast with DolbyDigital5.1, disabling video decoding",recvnumber);
}
+
}
}
}
@@ -655,6 +648,11 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
if (!markFileName[0]) strcpy(markFileName,"marks.vdr");
}
+ if (!LoadInfo(Directory))
+ {
+ if (bDecodeVideo) esyslog("markad [%i]: failed loading info - logo detection impossible",recvnumber);
+ }
+
if (macontext.General.VPid.Num)
{
if (isTS)
@@ -699,11 +697,6 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
if (!abort)
{
- if (!LoadInfo(Directory))
- {
- esyslog("markad [%i]: failed loading info - logo detection impossible",recvnumber);
- }
-
decoder = new cMarkAdDecoder(recvnumber,macontext.General.VPid.Type==MARKAD_PIDTYPE_VIDEO_H264,
macontext.General.APid.Num!=0,macontext.General.DPid.Num!=0);
video = new cMarkAdVideo(recvnumber,&macontext);
diff --git a/streaminfo.cpp b/streaminfo.cpp
index 4167b7c..f28b4e7 100644
--- a/streaminfo.cpp
+++ b/streaminfo.cpp
@@ -409,7 +409,7 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt,
{
bs.skipBits(2); // colour_plane_id
}
- bs.skipBits(H264.log2_max_frame_num); // frame_num
+ int frame_num=bs.getBits(H264.log2_max_frame_num); // frame_num
maContext->Video.Info.Interlaced=false;
if (!H264.frame_mbs_only_flag)
@@ -455,10 +455,12 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt,
}
maContext->Video.Info.Pict_Type=slice_type;
- return true;
+ if (frame_num!=H264.frame_num)
+ {
+ H264.frame_num=frame_num;
+ return true;
+ }
}
-
-
return false;
}
diff --git a/streaminfo.h b/streaminfo.h
index dc712be..19e119c 100644
--- a/streaminfo.h
+++ b/streaminfo.h
@@ -35,6 +35,7 @@ private:
bool separate_colour_plane_flag;
bool frame_mbs_only_flag;
int log2_max_frame_num;
+ int frame_num;
} H264;
int nalUnescape(uint8_t *dst, const uint8_t *src, int len);