diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-09-04 10:13:14 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-09-04 10:13:14 +0200 |
commit | 96061c5b40cc940d9ae2860ba0a1a941486f3cf1 (patch) | |
tree | 1ea70e1b8dae716a5b9b1c57b6b7f5d73accbfac /recording.c | |
parent | 6c110a7272f7a6e57f93f4de4c6792ebbbccbf1e (diff) | |
download | vdr-96061c5b40cc940d9ae2860ba0a1a941486f3cf1.tar.gz vdr-96061c5b40cc940d9ae2860ba0a1a941486f3cf1.tar.bz2 |
Revoked the changes to cFrameDetector that have been introduced in version 1.7.19
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/recording.c b/recording.c index 93433cc7..bea7eb6b 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 2.37 2011/08/27 10:55:53 kls Exp $ + * $Id: recording.c 2.38 2011/09/04 09:32:25 kls Exp $ */ #include "recording.h" @@ -1434,12 +1434,11 @@ void cIndexFileGenerator::Action(void) bool Rewind = false; cFileName FileName(recordingName, false); cUnbufferedFile *ReplayFile = FileName.Open(); - cRingBufferLinear Buffer(IFG_BUFFER_SIZE, TS_SIZE); + cRingBufferLinear Buffer(IFG_BUFFER_SIZE, MIN_TS_PACKETS_FOR_FRAME_DETECTOR * TS_SIZE); cPatPmtParser PatPmtParser; cFrameDetector FrameDetector; cIndexFile IndexFile(recordingName, true); int BufferChunks = KILOBYTE(1); // no need to read a lot at the beginning when parsing PAT/PMT - int FileNumber = 0; off_t FileSize = 0; off_t FrameOffset = -1; Skins.QueueMessage(mtInfo, tr("Regenerating index file")); @@ -1456,18 +1455,12 @@ void cIndexFileGenerator::Action(void) if (Data) { if (FrameDetector.Synced()) { // Step 3 - generate the index: - if (FrameOffset < 0 && TsPid(Data) == PATPID) { - FileNumber = FileName.Number(); + if (TsPid(Data) == PATPID) FrameOffset = FileSize; // the PAT/PMT is at the beginning of an I-frame - } int Processed = FrameDetector.Analyze(Data, Length); if (Processed > 0) { - if (FrameDetector.NewPayload() && FrameOffset < 0) { - FileNumber = FileName.Number(); - FrameOffset = FileSize; - } if (FrameDetector.NewFrame()) { - IndexFile.Write(FrameDetector.IndependentFrame(), FileNumber, FrameOffset); + IndexFile.Write(FrameDetector.IndependentFrame(), FileName.Number(), FrameOffset >= 0 ? FrameOffset : FileSize); FrameOffset = -1; } FileSize += Processed; |