diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-09-13 11:18:53 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-09-13 11:18:53 +0200 |
commit | cc16e9fdc73bcba6cc5fb677111cf76fcbc6a2c7 (patch) | |
tree | 69b2692a52acf158ab60161e6aa7a6076d28d44e /recording.c | |
parent | e775f25add85c3c36df7e8601fbd472c8fbd2b09 (diff) | |
download | vdr-cc16e9fdc73bcba6cc5fb677111cf76fcbc6a2c7.tar.gz vdr-cc16e9fdc73bcba6cc5fb677111cf76fcbc6a2c7.tar.bz2 |
If regenerating an index file fails and no data is written to the file, VDR now reports this error and removes the empty index file
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/recording.c b/recording.c index 9c80505e..49c5276e 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.60 2012/09/06 09:57:31 kls Exp $ + * $Id: recording.c 2.61 2012/09/13 11:02:17 kls Exp $ */ #include "recording.h" @@ -1483,6 +1483,7 @@ cIndexFileGenerator::~cIndexFileGenerator() void cIndexFileGenerator::Action(void) { bool IndexFileComplete = false; + bool IndexFileWritten = false; bool Rewind = false; cFileName FileName(recordingName, false); cUnbufferedFile *ReplayFile = FileName.Open(); @@ -1514,6 +1515,7 @@ void cIndexFileGenerator::Action(void) if (FrameDetector.NewFrame()) { IndexFile.Write(FrameDetector.IndependentFrame(), FileName.Number(), FrameOffset >= 0 ? FrameOffset : FileSize); FrameOffset = -1; + IndexFileWritten = true; } FileSize += Processed; Buffer.Del(Processed); @@ -1568,11 +1570,16 @@ void cIndexFileGenerator::Action(void) break; } } + if (IndexFileComplete) { + if (IndexFileWritten) { + Skins.QueueMessage(mtInfo, tr("Index file regeneration complete")); + return; + } + else + Skins.QueueMessage(mtError, tr("Index file regeneration failed!")); + } // Delete the index file if the recording has not been processed entirely: - if (IndexFileComplete) - Skins.QueueMessage(mtInfo, tr("Index file regeneration complete")); - else - IndexFile.Delete(); + IndexFile.Delete(); } // --- cIndexFile ------------------------------------------------------------ |