summaryrefslogtreecommitdiff
path: root/command
diff options
context:
space:
mode:
Diffstat (limited to 'command')
-rw-r--r--command/markad-standalone.h15
-rw-r--r--command/marks.cpp19
-rw-r--r--command/marks.h1
3 files changed, 24 insertions, 11 deletions
diff --git a/command/markad-standalone.h b/command/markad-standalone.h
index 3f83032..50e3b6a 100644
--- a/command/markad-standalone.h
+++ b/command/markad-standalone.h
@@ -188,7 +188,6 @@ unsigned Descriptor_Length:
bool abort;
bool gotendmark;
- bool reprocess;
int waittime;
int iwaittime;
struct timeval tv1,tv2;
@@ -208,10 +207,7 @@ unsigned Descriptor_Length:
time_t startTime; // starttime of broadcast
int length; // length of broadcast in seconds
int tStart; // pretimer in seconds
- int iStart; // pretimer as index value
- int iStartCheck; // check position for iStart
- int iStop; // posttimer as index value
- int iStopCheck; // check position for iStop
+ int iStart; // pretimer in frames
int skipped; // skipped bytes in whole file
bool inBroadCast; // are we in a broadcast (or ad)?
@@ -222,6 +218,9 @@ unsigned Descriptor_Length:
bool setVideo43LB; // set video to 4:3 letterbox in info
bool setVideo169; // set video to 16:9 in info
#endif
+
+ void CheckStart();
+ void CalculateCheckPositions(int startframe, int delta);
int chkLEFT;
int chkRIGHT;
@@ -232,14 +231,8 @@ unsigned Descriptor_Length:
void SaveFrame(int Frame);
- bool aspectChecked;
- bool marksAligned;
-
clMarks marks;
char *IndexToHMSF(int Index);
- void CalculateStopPosition(int startframe, int delta);
- void CheckAspectRatio_and_AudioChannels();
- void InitStartStop();
void AddMark(MarkAdMark *Mark);
bool Reset(bool FirstPass=true);
void ChangeMarks(clMark **Mark1, clMark **Mark2, MarkAdPos *NewPos);
diff --git a/command/marks.cpp b/command/marks.cpp
index f06416d..8442872 100644
--- a/command/marks.cpp
+++ b/command/marks.cpp
@@ -186,6 +186,25 @@ clMark *clMarks::Get(int Position)
return mark;
}
+clMark *clMarks::GetAround(int Position, int Type, int Mask)
+{
+ clMark *m1=GetPrev(Position,Type,Mask);
+ clMark *m2=GetNext(Position,Type,Mask);
+
+ if (!m1 && !m2) return NULL;
+ if (!m1 && m2) return m2;
+ if (m1 && !m2) return m1;
+
+ if (abs(m1->position-Position)>abs(m2->position-Position))
+ {
+ return m2;
+ }
+ else
+ {
+ return m1;
+ }
+}
+
clMark *clMarks::GetPrev(int Position, int Type, int Mask)
{
if (!first) return NULL; // no elements yet
diff --git a/command/marks.h b/command/marks.h
index 7c31ba9..8c4a890 100644
--- a/command/marks.h
+++ b/command/marks.h
@@ -100,6 +100,7 @@ public:
void Del(unsigned char Type);
void Del(int Position);
clMark *Get(int Position);
+ clMark *GetAround(int Position, int Type=0xFF, int Mask=0xFF);
clMark *GetPrev(int Position,int Type=0xFF, int Mask=0xFF);
clMark *GetNext(int Position,int Type=0xFF, int Mask=0xFF);
clMark *GetFirst()