summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-12 14:53:59 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-12 14:53:59 +0100
commited10aaf68bbd519856430b7f6e6223a243feffc0 (patch)
treeb39124d14626ec594ad939fe53331e7c277847c3 /recording.c
parent9fa1654d0442bdf83dda528f88f306e37bf56c1c (diff)
downloadvdr-ed10aaf68bbd519856430b7f6e6223a243feffc0.tar.gz
vdr-ed10aaf68bbd519856430b7f6e6223a243feffc0.tar.bz2
Improved fast forwarding to the end of a timeshift recording
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/recording.c b/recording.c
index 47a9881a..a4076ed4 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.51 2012/02/26 13:58:26 kls Exp $
+ * $Id: recording.c 2.52 2012/03/12 14:49:28 kls Exp $
*/
#include "recording.h"
@@ -1526,9 +1526,6 @@ void cIndexFileGenerator::Action(void)
#define INDEXFILESUFFIX "/index"
-// The number of frames to stay off the end in case of time shift:
-#define INDEXSAFETYLIMIT 150 // frames
-
// The maximum time to wait before giving up while catching up on an index file:
#define MAXINDEXCATCHUP 8 // seconds
@@ -1728,7 +1725,7 @@ bool cIndexFile::CatchUp(int Index)
}
else
LOG_ERROR_STR(*fileName);
- if (Index < last - (i ? 2 * INDEXSAFETYLIMIT : 0) || Index > 10 * INDEXSAFETYLIMIT) // keep off the end in case of "Pause live video"
+ if (Index < last)
break;
cCondWait::SleepMs(1000);
}
@@ -1775,13 +1772,13 @@ bool cIndexFile::Get(int Index, uint16_t *FileNumber, off_t *FileOffset, bool *I
return false;
}
-int cIndexFile::GetNextIFrame(int Index, bool Forward, uint16_t *FileNumber, off_t *FileOffset, int *Length, bool StayOffEnd)
+int cIndexFile::GetNextIFrame(int Index, bool Forward, uint16_t *FileNumber, off_t *FileOffset, int *Length)
{
if (CatchUp()) {
int d = Forward ? 1 : -1;
for (;;) {
Index += d;
- if (Index >= 0 && Index < last - ((Forward && StayOffEnd) ? INDEXSAFETYLIMIT : 0)) {
+ if (Index >= 0 && Index < last) {
if (index[Index].independent) {
uint16_t fn;
if (!FileNumber)