diff options
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/recording.c b/recording.c index 317e6305..4456bddb 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.32 2011/08/13 10:59:32 kls Exp $ + * $Id: recording.c 2.33 2011/08/13 12:37:25 kls Exp $ */ #include "recording.h" @@ -1816,6 +1816,15 @@ void cIndexFile::Delete(void) } } +int cIndexFile::GetLength(const char *FileName, bool IsPesRecording) +{ + struct stat buf; + cString s = IndexFileName(FileName, IsPesRecording); + if (*s && stat(s, &buf) == 0) + return buf.st_size / (IsPesRecording ? sizeof(tIndexTs) : sizeof(tIndexPes)); + return -1; +} + bool GenerateIndex(const char *FileName) { if (DirectoryOk(FileName)) { |