summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-01-23 14:43:50 +0100
committerJochen Dolze <vdr@dolze.de>2011-01-23 14:43:50 +0100
commit8fea50efbf91e0eeb57daafa97efc163d7325690 (patch)
treeb18189932aaebf7f6d5c6a9c170162aed7973b54
parent0afda6d34adb77ffbce433b3b9a4c6e8a3e1f3b7 (diff)
downloadvdr-plugin-markad-8fea50efbf91e0eeb57daafa97efc163d7325690.tar.gz
vdr-plugin-markad-8fea50efbf91e0eeb57daafa97efc163d7325690.tar.bz2
New Version 0.0.8v0.0.8
-rw-r--r--HISTORY4
-rw-r--r--command/markad-standalone.cpp144
-rw-r--r--command/markad-standalone.h1
-rw-r--r--command/video.cpp2
-rw-r--r--version.h2
5 files changed, 69 insertions, 84 deletions
diff --git a/HISTORY b/HISTORY
index d8cb26e..967962a 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,9 @@
VDR Plugin 'markad' Revision History
----------------------------------
+2011-01-23: Version 0.0.8
+
+- Improved HD handling
+
2010-05-22: Version 0.0.7
- Various bugfixes
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index a3922a9..3d129a6 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -1325,8 +1325,7 @@ bool cMarkAdStandalone::ProcessFile(int Number)
if (macontext.Video.Info.FramesPerSecond<0)
{
macontext.Video.Info.FramesPerSecond*=-1;
- if (!setFrameRate) isyslog("framerate wrong or unset, using %.f",macontext.Video.Info.FramesPerSecond);
- setFrameRate=true;
+ isyslog("using framerate of %.f",macontext.Video.Info.FramesPerSecond);
}
if ((decoder) && (bDecodeVideo))
@@ -1587,8 +1586,8 @@ bool cMarkAdStandalone::SetFileUID(char *File)
bool cMarkAdStandalone::SaveInfo()
{
- if ((!setVideo43) && (!setVideo169) && (!setAudio20) && (!setAudio51) && (!setVideo43LB) &&
- (!setFrameRate)) return true;
+ if ((!setVideo43) && (!setVideo169) && (!setAudio20) && (!setAudio51) && (!setVideo43LB)) return true;
+
char *src,*dst;
if (asprintf(&src,"%s/info%s",directory,isTS ? "" : ".vdr")==-1) return false;
@@ -1619,7 +1618,6 @@ bool cMarkAdStandalone::SaveInfo()
bool setVideo169_done=false;
bool setAudio20_done=false;
bool setAudio51_done=false;
- bool setFrameRate_done=false;
char lang[4]="";
@@ -1646,96 +1644,91 @@ bool cMarkAdStandalone::SaveInfo()
bool err=false;
while (getline(&line,&length,r)!=-1)
{
- if ((line[0]=='F') && (setFrameRate))
+ if (line[0]=='X')
{
- if (fprintf(w,"F %i\n",(int) macontext.Video.Info.FramesPerSecond)<=0) err=true;
- setFrameRate_done=true;
- }
- else
- if (line[0]=='X')
- {
- int stream=0,type=0;
- char descr[256]="";
+ int stream=0,type=0;
+ char descr[256]="";
- int result=sscanf(line,"%*c %i %i %3c %250c",&stream,&type,(char *) &lang, (char *) &descr);
- if ((result!=0) && (result!=EOF))
+ int result=sscanf(line,"%*c %i %i %3c %250c",&stream,&type,(char *) &lang, (char *) &descr);
+ if ((result!=0) && (result!=EOF))
+ {
+ switch (stream)
{
- switch (stream)
+ case 1:
+ case 5:
+ if (stream==stream_content)
{
- case 1:
- case 5:
- if (stream==stream_content)
+ if ( (((type==1) || (type==5)) && (setVideo169)) ||
+ (((type==3) || (type==7)) && ((setVideo43) || (setVideo43LB))))
{
- if ( (((type==1) || (type==5)) && (setVideo169)) ||
- (((type==3) || (type==7)) && ((setVideo43) || (setVideo43LB))))
- {
- if (setVideo43)
- {
- if (fprintf(w,"X %i %02i %s 4:3\n",stream_content,
- component_type_43+component_type_add,lang)<=0) err=true;
- setVideo43_done=true;
- }
- if (setVideo43LB)
- {
- if (fprintf(w,"X %i %02i %s 4:3 LetterBox\n",stream_content,
- component_type_43+component_type_add,lang)<=0) err=true;
- setVideo43LB_done=true;
- }
- if (setVideo169)
- {
- if (fprintf(w,"X %i %02i %s 16:9\n",stream_content,
- component_type_169+component_type_add,lang)<=0) err=true;
- setVideo169_done=true;
- }
- }
- else
+ if (setVideo43)
{
- if (fprintf(w,"%s",line)<=0) err=true;
+ if (fprintf(w,"X %i %02i %s 4:3\n",stream_content,
+ component_type_43+component_type_add,lang)<=0) err=true;
+ setVideo43_done=true;
}
- }
- break;
- case 2:
- if ((type==5) && ((setAudio51) || (setAudio20)))
- {
- if (setAudio51)
+ if (setVideo43LB)
{
- if (fprintf(w,"X 2 05 %s Dolby Digital 5.1\n",lang)<=0) err=true;
- setAudio51_done=true;
+ if (fprintf(w,"X %i %02i %s 4:3 LetterBox\n",stream_content,
+ component_type_43+component_type_add,lang)<=0) err=true;
+ setVideo43_done=true;
+ setVideo43LB_done=true;
}
- if (setAudio20)
+ if (setVideo169)
{
- if (fprintf(w,"X 2 05 %s Dolby Digital 2.0\n",lang)<=0) err=true;
- setAudio20_done=true;
+ if (fprintf(w,"X %i %02i %s 16:9\n",stream_content,
+ component_type_169+component_type_add,lang)<=0) err=true;
+ setVideo169_done=true;
}
}
else
{
if (fprintf(w,"%s",line)<=0) err=true;
}
- break;
- default:
+ }
+ break;
+ case 2:
+ if ((type==5) && ((setAudio51) || (setAudio20)))
+ {
+ if (setAudio51)
+ {
+ if (fprintf(w,"X 2 05 %s Dolby Digital 5.1\n",lang)<=0) err=true;
+ setAudio51_done=true;
+ }
+ if (setAudio20)
+ {
+ if (fprintf(w,"X 2 05 %s Dolby Digital 2.0\n",lang)<=0) err=true;
+ setAudio20_done=true;
+ }
+ }
+ else
+ {
if (fprintf(w,"%s",line)<=0) err=true;
- break;
}
+ break;
+ default:
+ if (fprintf(w,"%s",line)<=0) err=true;
+ break;
}
}
+ }
+ else
+ {
+ if (line[0]!='@')
+ {
+ if (fprintf(w,"%s",line)<=0) err=true;
+ }
else
{
- if (line[0]!='@')
+ if (lline)
{
- if (fprintf(w,"%s",line)<=0) err=true;
- }
- else
- {
- if (lline)
- {
- free(lline);
- err=true;
- esyslog("multiple @lines in info file, please report this!");
- }
- lline=strdup(line);
+ free(lline);
+ err=true;
+ esyslog("multiple @lines in info file, please report this!");
}
+ lline=strdup(line);
}
+ }
if (err) break;
}
if (line) free(line);
@@ -1770,10 +1763,6 @@ bool cMarkAdStandalone::SaveInfo()
{
if (fprintf(w,"X 2 05 %s Dolby Digital 5.1\n",lang)<=0) err=true;
}
- if ((setFrameRate) && (!setFrameRate_done) && (!err))
- {
- if (fprintf(w,"F %i\n",(int) macontext.Video.Info.FramesPerSecond)<=0) err=true;
- }
if (line)
{
if (fprintf(w,"%s",line)<=0) err=true;
@@ -1881,7 +1870,6 @@ bool cMarkAdStandalone::LoadInfo()
char *line=NULL;
size_t linelen;
- setFrameRate=true;
while (getline(&line,&linelen,f)!=-1)
{
if (line[0]=='C')
@@ -1938,12 +1926,6 @@ bool cMarkAdStandalone::LoadInfo()
else
{
macontext.Video.Info.FramesPerSecond=fps;
- setFrameRate=false;
- if (fps<40)
- {
- // assumption
- macontext.Video.Info.Interlaced=true;
- }
}
}
if (line[0]=='X')
diff --git a/command/markad-standalone.h b/command/markad-standalone.h
index e93b6a9..78f0ea9 100644
--- a/command/markad-standalone.h
+++ b/command/markad-standalone.h
@@ -221,7 +221,6 @@ unsigned Descriptor_Length:
bool setVideo43; // set video to 4:3 in info
bool setVideo43LB; // set video to 4:3 letterbox in info
bool setVideo169; // set video to 16:9 in info
- bool setFrameRate; // set framerate in info
int chkLEFT;
int chkRIGHT;
diff --git a/command/video.cpp b/command/video.cpp
index 0969aad..77b77fa 100644
--- a/command/video.cpp
+++ b/command/video.cpp
@@ -714,7 +714,7 @@ MarkAdPos *cMarkAdOverlap::Process(int FrameNumber, int Frames, bool BeforeAd)
{
if ((lastframenumber>0) && (!similarMaxCnt))
{
- similarCutOff=50000; // lower is harder!
+ similarCutOff=60000; // lower is harder!
similarMaxCnt=4;
}
diff --git a/version.h b/version.h
index 264f634..6a720a7 100644
--- a/version.h
+++ b/version.h
@@ -8,6 +8,6 @@
#ifndef __version_h_
#define __version_h_
-static const char *VERSION = "0.0.7";
+static const char *VERSION = "0.0.8";
#endif