diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-31 13:14:26 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-10-31 13:14:26 +0100 |
commit | 697261c981fa877b94661d310c07b216ca708f4f (patch) | |
tree | cd24930cf7529657301f8d886dc510bdc594c989 /cutter.c | |
parent | 998e3bd2c7d19485d001f1531d93fda2e92edb03 (diff) | |
download | vdr-697261c981fa877b94661d310c07b216ca708f4f.tar.gz vdr-697261c981fa877b94661d310c07b216ca708f4f.tar.bz2 |
The new class cUnbufferedFile is used for the recording files to avoid thrashing the file system cache1.3.35
Diffstat (limited to 'cutter.c')
-rw-r--r-- | cutter.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: cutter.c 1.10 2005/08/14 10:51:54 kls Exp $ + * $Id: cutter.c 1.11 2005/10/31 12:26:44 kls Exp $ */ #include "cutter.h" @@ -18,7 +18,7 @@ class cCuttingThread : public cThread { private: const char *error; - int fromFile, toFile; + cUnbufferedFile *fromFile, *toFile; cFileName *fromFileName, *toFileName; cIndexFile *fromIndex, *toIndex; cMarks fromMarks, toMarks; @@ -34,7 +34,7 @@ cCuttingThread::cCuttingThread(const char *FromFileName, const char *ToFileName) :cThread("video cutting") { error = NULL; - fromFile = toFile = -1; + fromFile = toFile = NULL; fromFileName = toFileName = NULL; fromIndex = toIndex = NULL; if (fromMarks.Load(FromFileName) && fromMarks.Count()) { @@ -64,7 +64,7 @@ void cCuttingThread::Action(void) if (Mark) { fromFile = fromFileName->Open(); toFile = toFileName->Open(); - if (fromFile < 0 || toFile < 0) + if (!fromFile || !toFile) return; int Index = Mark->position; Mark = fromMarks.Next(Mark); @@ -92,7 +92,7 @@ void cCuttingThread::Action(void) fromFile = fromFileName->SetOffset(FileNumber, FileOffset); CurrentFileNumber = FileNumber; } - if (fromFile >= 0) { + if (fromFile) { int len = ReadFrame(fromFile, buffer, Length, sizeof(buffer)); if (len < 0) { error = "ReadFrame"; @@ -131,7 +131,7 @@ void cCuttingThread::Action(void) cutIn = false; } } - if (safe_write(toFile, buffer, Length) < 0) { + if (toFile->Write(buffer, Length) < 0) { error = "safe_write"; break; } |