diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-24 15:24:19 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-01-24 15:24:19 +0100 |
commit | f01af488e1063871e8392bced356eb7196a5040f (patch) | |
tree | 00ca482c8cb119e4455e61c5d3f0ec9c14d49271 | |
parent | 85e34776ff520d001cb6e0236a3308f143f093f0 (diff) | |
download | vdr-f01af488e1063871e8392bced356eb7196a5040f.tar.gz vdr-f01af488e1063871e8392bced356eb7196a5040f.tar.bz2 |
Fixed handling the maximum video file size
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | cutter.c | 8 | ||||
-rw-r--r-- | menu.c | 4 | ||||
-rw-r--r-- | recording.h | 17 |
6 files changed, 21 insertions, 14 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 98d5ca42..a3095b9e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1605,6 +1605,7 @@ Udo Richter <udo_richter@gmx.de> for fixing error handling in cCuttingThread::Action() for suppressing the automatic shutdown if the remote control is currently disabled for fixing a problem with calling isyslog() from within the SignalHandler() + for reporting a problem with handling the maximum video file size Sven Kreiensen <svenk@kammer.uni-hannover.de> for his help in keeping 'channels.conf.terr' up to date @@ -5965,3 +5965,4 @@ Video Disk Recorder Revision History it's an I-frame or not. - The PAT/PMT is now only processed if its version changes (reported by Reinhard Nissl). +- Fixed handling the maximum video file size (reported by Udo Richter). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.161 2008/02/17 13:39:00 kls Exp $ + * $Id: config.c 2.1 2009/01/24 15:05:32 kls Exp $ */ #include "config.h" @@ -275,7 +275,7 @@ cSetup::cSetup(void) FontOsdSize = 22; FontSmlSize = 18; FontFixSize = 20; - MaxVideoFileSize = MAXVIDEOFILESIZE; + MaxVideoFileSize = MAXVIDEOFILESIZEDEFAULT; SplitEditedFiles = 0; MinEventTimeout = 30; MinUserInactivity = 300; @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: cutter.c 2.1 2009/01/06 14:40:48 kls Exp $ + * $Id: cutter.c 2.2 2009/01/24 15:19:26 kls Exp $ */ #include "cutter.h" @@ -22,6 +22,7 @@ private: cFileName *fromFileName, *toFileName; cIndexFile *fromIndex, *toIndex; cMarks fromMarks, toMarks; + off_t maxVideoFileSize; protected: virtual void Action(void); public: @@ -45,6 +46,9 @@ cCuttingThread::cCuttingThread(const char *FromFileName, const char *ToFileName) fromIndex = new cIndexFile(FromFileName, false, isPesRecording); toIndex = new cIndexFile(ToFileName, true, isPesRecording); toMarks.Load(ToFileName, Recording.FramesPerSecond(), isPesRecording); // doesn't actually load marks, just sets the file name + maxVideoFileSize = MEGABYTE(Setup.MaxVideoFileSize); + if (isPesRecording && maxVideoFileSize > MEGABYTE(MAXVIDEOFILESIZEPES)) + maxVideoFileSize = MEGABYTE(MAXVIDEOFILESIZEPES); Start(); } else @@ -125,7 +129,7 @@ void cCuttingThread::Action(void) if (Independent) { // every file shall start with an independent frame if (LastMark) // edited version shall end before next I-frame break; - if (FileSize > MEGABYTE(Setup.MaxVideoFileSize)) { + if (FileSize > maxVideoFileSize) { toFile = toFileName->NextFile(); if (!toFile) { error = "toFile 1"; @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 2.5 2009/01/24 11:42:24 kls Exp $ + * $Id: menu.c 2.6 2009/01/24 15:05:43 kls Exp $ */ #include "menu.h" @@ -2698,7 +2698,7 @@ cMenuSetupRecord::cMenuSetupRecord(void) Add(new cMenuEditBoolItem(tr("Setup.Recording$Mark instant recording"), &data.MarkInstantRecord)); Add(new cMenuEditStrItem( tr("Setup.Recording$Name instant recording"), data.NameInstantRecord, sizeof(data.NameInstantRecord))); Add(new cMenuEditIntItem( tr("Setup.Recording$Instant rec. time (min)"), &data.InstantRecordTime, 1, MAXINSTANTRECTIME)); - Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE)); + Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZETS)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles)); } diff --git a/recording.h b/recording.h index 119dd46e..5256a8ee 100644 --- a/recording.h +++ b/recording.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.h 2.3 2009/01/24 13:05:03 kls Exp $ + * $Id: recording.h 2.4 2009/01/24 15:24:19 kls Exp $ */ #ifndef __RECORDING_H @@ -209,13 +209,14 @@ public: #define MAXFRAMESIZE KILOBYTE(512) // The maximum file size is limited by the range that can be covered -// with 'int'. 4GB might be possible (if the range is considered -// 'unsigned'), 2GB should be possible (even if the range is considered -// 'signed'), so let's use 2000MB for absolute safety (the actual file size -// may be slightly higher because we stop recording only before the next -// 'I' frame, to have a complete Group Of Pictures): -#define MAXVIDEOFILESIZE 2000 // MB -#define MINVIDEOFILESIZE 100 // MB +// with a 40 bit 'unsigned int', which is 1TB. The actual maximum value +// used is 6MB below the theoretical maximum, to have some safety (the +// actual file size may be slightly higher because we stop recording only +// before the next independent frame, to have a complete Group Of Pictures): +#define MAXVIDEOFILESIZETS 1048570 // MB +#define MAXVIDEOFILESIZEPES 2000 // MB +#define MINVIDEOFILESIZE 100 // MB +#define MAXVIDEOFILESIZEDEFAULT MAXVIDEOFILESIZEPES struct tIndexTs; |