summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-11-07 23:20:08 +0100
committerJochen Dolze <vdr@dolze.de>2010-11-07 23:20:08 +0100
commitd48a56868074ae2cb71bb6be45fa62aa9f5c2076 (patch)
tree9fedf03b2ef838573414eaf7e5de973dc3fd5156
parenta6fb12c83bb712faa270b3cba7ff3d2b17b0209e (diff)
downloadvdr-plugin-markad-d48a56868074ae2cb71bb6be45fa62aa9f5c2076.tar.gz
vdr-plugin-markad-d48a56868074ae2cb71bb6be45fa62aa9f5c2076.tar.bz2
Rewrote GenIndex (works with SDTV-PES, should work with SDTV-TS, unknown on HDTV-TS)
-rw-r--r--command/markad-standalone.cpp8
-rw-r--r--command/markad-standalone.h2
-rw-r--r--command/marks.cpp29
-rw-r--r--command/marks.h1
4 files changed, 19 insertions, 21 deletions
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index b74e6e3..7d882f5 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -1244,18 +1244,12 @@ bool cMarkAdStandalone::ProcessFile(int Number)
if (!framecnt)
{
AddStartMark();
- nextPictType=MA_I_TYPE;
}
if (macontext.Config->GenIndex)
{
- if (macontext.Info.VPid.Type==MARKAD_PIDTYPE_VIDEO_H262)
- {
- nextPictType=macontext.Video.Info.Pict_Type;
- }
- marks.WriteIndex(directory,isTS,offset,nextPictType,Number);
+ marks.WriteIndex(directory,isTS,offset,macontext.Video.Info.Pict_Type,Number);
}
- nextPictType=macontext.Video.Info.Pict_Type;
framecnt++;
if (macontext.Video.Info.Pict_Type==MA_I_TYPE)
diff --git a/command/markad-standalone.h b/command/markad-standalone.h
index f22310a..adb718a 100644
--- a/command/markad-standalone.h
+++ b/command/markad-standalone.h
@@ -216,8 +216,6 @@ unsigned Descriptor_Length:
bool setVideo43LB; // set video to 4:3 letterbox in info
bool setVideo169; // set video to 16:9 in info
- int nextPictType;
-
int chkLEFT;
int chkRIGHT;
diff --git a/command/marks.cpp b/command/marks.cpp
index a59840b..2ebef9f 100644
--- a/command/marks.cpp
+++ b/command/marks.cpp
@@ -452,19 +452,9 @@ bool clMarks::ReadIndex(const char *Directory, bool isTS, int FrameNumber, int R
return true;
}
-void clMarks::WriteIndex(const char *Directory, bool isTS, uint64_t Offset,
- int FrameType, int Number)
+void clMarks::WriteIndex(bool isTS, uint64_t Offset, int FrameType, int Number)
{
- if (indexfd==-1)
- {
- char *ipath=NULL;
- if (asprintf(&ipath,"%s/index%s.generated",Directory,isTS ? "" : ".vdr")==-1) return;
- indexfd=open(ipath,O_WRONLY|O_CREAT|O_TRUNC,0644);
- free(ipath);
- if (indexfd==-1) return;
- Offset=0;
- FrameType=1;
- }
+ if (indexfd==-1) return;
if (isTS)
{
struct tIndexTS IndexTS;
@@ -483,6 +473,21 @@ void clMarks::WriteIndex(const char *Directory, bool isTS, uint64_t Offset,
IndexVDR.reserved=0;
if (write(indexfd,&IndexVDR,sizeof(IndexVDR))!=sizeof(IndexVDR)) return;
}
+}
+
+void clMarks::WriteIndex(const char *Directory, bool isTS, uint64_t Offset,
+ int FrameType, int Number)
+{
+ if (indexfd==-1)
+ {
+ char *ipath=NULL;
+ if (asprintf(&ipath,"%s/index%s.generated",Directory,isTS ? "" : ".vdr")==-1) return;
+ indexfd=open(ipath,O_WRONLY|O_CREAT|O_TRUNC,0644);
+ free(ipath);
+ if (indexfd==-1) return;
+ if (Offset>376) WriteIndex(isTS,0,1,Number);
+ }
+ WriteIndex(isTS,Offset,FrameType,Number);
return;
}
diff --git a/command/marks.h b/command/marks.h
index 6a488f7..7c31ba9 100644
--- a/command/marks.h
+++ b/command/marks.h
@@ -73,6 +73,7 @@ uint16_t number:
int count;
int savedcount;
int indexfd;
+ void WriteIndex(bool isTS, uint64_t Offset,int FrameType, int Number);
public:
clMarks()
{