1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling the maximum video file size

This commit is contained in:
Klaus Schmidinger 2009-01-24 15:24:19 +01:00
parent 85e34776ff
commit f01af488e1
6 changed files with 21 additions and 14 deletions

View File

@ -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

View File

@ -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).

View File

@ -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;

View File

@ -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
menu.c
View File

@ -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));
}

View File

@ -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;