mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Implemented option '-i'
This commit is contained in:
parent
3def525dc4
commit
3434f061b3
@ -2214,6 +2214,8 @@ Frank Schmirler <vdr@schmirler.de>
|
||||
allowed characters
|
||||
for fixing handling address masks in SVDRP host settings
|
||||
for fixing handling the 'pointer field' in generating and parsing PAT/PMT
|
||||
for suggesting to use an "instance id" instead of the "resume id" to distinguish
|
||||
recordings of the same broadcast made by different instances of VDR
|
||||
|
||||
Jörn Reder <joern@zyn.de>
|
||||
for reporting that a recording may unnecessarily block a device with a CAM, while
|
||||
|
4
HISTORY
4
HISTORY
@ -5939,3 +5939,7 @@ Video Disk Recorder Revision History
|
||||
to Make.config.template (thanks to Johann Friedrichs for pointing this out).
|
||||
Plugin authors should add this line to their Makefile or Make.config if they use
|
||||
file access functions that need special versions for 64 bit offsets.
|
||||
- The new command line option -i can be used to set an "instance id", which will
|
||||
be used to distinguish recordings of the same broadcast made by different instances
|
||||
of VDR (suggested by Frank Schmirler). This replaces the use of the "resume id"
|
||||
that was introduced in version 1.7.3.
|
||||
|
13
recording.c
13
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.5 2009/01/16 15:55:18 kls Exp $
|
||||
* $Id: recording.c 2.6 2009/01/18 11:02:09 kls Exp $
|
||||
*/
|
||||
|
||||
#include "recording.h"
|
||||
@ -64,6 +64,7 @@
|
||||
#define MAX_LINK_LEVEL 6
|
||||
|
||||
bool VfatFileSystem = false;
|
||||
int InstanceId = 0;
|
||||
|
||||
cRecordings DeletedRecordings(true);
|
||||
|
||||
@ -602,7 +603,7 @@ cRecording::cRecording(cTimer *Timer, const cEvent *Event)
|
||||
name = NULL;
|
||||
fileSizeMB = -1; // unknown
|
||||
channel = Timer->Channel()->Number();
|
||||
resumeId = Setup.ResumeID;
|
||||
instanceId = InstanceId;
|
||||
isPesRecording = false;
|
||||
framesPerSecond = DEFAULTFRAMESPERSECOND;
|
||||
deleted = 0;
|
||||
@ -659,7 +660,7 @@ cRecording::cRecording(const char *FileName)
|
||||
resume = RESUME_NOT_INITIALIZED;
|
||||
fileSizeMB = -1; // unknown
|
||||
channel = -1;
|
||||
resumeId = -1;
|
||||
instanceId = -1;
|
||||
priority = MAXPRIORITY; // assume maximum in case there is no info file
|
||||
lifetime = MAXLIFETIME;
|
||||
isPesRecording = false;
|
||||
@ -678,7 +679,7 @@ cRecording::cRecording(const char *FileName)
|
||||
struct tm tm_r;
|
||||
struct tm t = *localtime_r(&now, &tm_r); // this initializes the time zone in 't'
|
||||
t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
|
||||
if (7 == sscanf(p + 1, DATAFORMATTS, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &channel, &resumeId)
|
||||
if (7 == sscanf(p + 1, DATAFORMATTS, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &channel, &instanceId)
|
||||
|| 7 == sscanf(p + 1, DATAFORMATPES, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &priority, &lifetime)) {
|
||||
t.tm_year -= 1900;
|
||||
t.tm_mon--;
|
||||
@ -688,7 +689,7 @@ cRecording::cRecording(const char *FileName)
|
||||
strncpy(name, FileName, p - FileName);
|
||||
name[p - FileName] = 0;
|
||||
name = ExchangeChars(name, false);
|
||||
isPesRecording = resumeId < 0;
|
||||
isPesRecording = instanceId < 0;
|
||||
}
|
||||
else
|
||||
return;
|
||||
@ -827,7 +828,7 @@ const char *cRecording::FileName(void) const
|
||||
struct tm *t = localtime_r(&start, &tm_r);
|
||||
const char *fmt = isPesRecording ? NAMEFORMATPES : NAMEFORMATTS;
|
||||
int ch = isPesRecording ? priority : channel;
|
||||
int ri = isPesRecording ? lifetime : resumeId;
|
||||
int ri = isPesRecording ? lifetime : instanceId;
|
||||
name = ExchangeChars(name, true);
|
||||
fileName = strdup(cString::sprintf(fmt, VideoDirectory, name, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, ch, ri));
|
||||
name = ExchangeChars(name, false);
|
||||
|
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: recording.h 2.1 2009/01/06 10:49:59 kls Exp $
|
||||
* $Id: recording.h 2.2 2009/01/18 11:02:00 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __RECORDING_H
|
||||
@ -19,6 +19,7 @@
|
||||
#include "tools.h"
|
||||
|
||||
extern bool VfatFileSystem;
|
||||
extern int InstanceId;
|
||||
|
||||
void RemoveDeletedRecordings(void);
|
||||
void AssertFreeDiskSpace(int Priority = 0, bool Force = false);
|
||||
@ -82,7 +83,7 @@ private:
|
||||
mutable char *name;
|
||||
mutable int fileSizeMB;
|
||||
int channel;
|
||||
int resumeId;
|
||||
int instanceId;
|
||||
bool isPesRecording;
|
||||
double framesPerSecond;
|
||||
cRecordingInfo *info;
|
||||
|
11
vdr.1
11
vdr.1
@ -8,7 +8,7 @@
|
||||
.\" License as specified in the file COPYING that comes with the
|
||||
.\" vdr distribution.
|
||||
.\"
|
||||
.\" $Id: vdr.1 1.33 2008/03/09 16:07:06 kls Exp $
|
||||
.\" $Id: vdr.1 2.1 2009/01/18 11:05:56 kls Exp $
|
||||
.\"
|
||||
.TH vdr 1 "10 Feb 2008" "1.6" "Video Disk Recorder"
|
||||
.SH NAME
|
||||
@ -71,6 +71,15 @@ grabbing images to disk is disabled.
|
||||
.B \-h, \-\-help
|
||||
Print a help message and exit.
|
||||
.TP
|
||||
.BI \-i\ instance ,\ \-\-instance= instance
|
||||
Use \fIinstance\fR as the id of this VDR instance (default is 0).
|
||||
In an environment where several instances of VDR use the same video
|
||||
directory, this parameter can be set to a positive integer value
|
||||
that's unique for each instance, so that they won't interfere with
|
||||
each other in case they record exactly the same broadcast.
|
||||
The number given here will be part of the directory name in which
|
||||
the recordings will be stored.
|
||||
.TP
|
||||
.BI \-l\ level ,\ \-\-log= level
|
||||
Set logging to \fIlevel\fR.
|
||||
\fB0\fR\ =\ no logging, \fB1\fR\ =\ errors only,
|
||||
|
12
vdr.c
12
vdr.c
@ -22,7 +22,7 @@
|
||||
*
|
||||
* The project's page is at http://www.cadsoft.de/vdr
|
||||
*
|
||||
* $Id: vdr.c 2.3 2008/09/06 14:08:44 kls Exp $
|
||||
* $Id: vdr.c 2.4 2009/01/18 11:02:37 kls Exp $
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
@ -223,6 +223,7 @@ int main(int argc, char *argv[])
|
||||
{ "epgfile", required_argument, NULL, 'E' },
|
||||
{ "grab", required_argument, NULL, 'g' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "instance", required_argument, NULL, 'i' },
|
||||
{ "lib", required_argument, NULL, 'L' },
|
||||
{ "lirc", optional_argument, NULL, 'l' | 0x100 },
|
||||
{ "localedir",required_argument, NULL, 'l' | 0x200 },
|
||||
@ -245,7 +246,7 @@ int main(int argc, char *argv[])
|
||||
};
|
||||
|
||||
int c;
|
||||
while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hl:L:mp:P:r:s:t:u:v:Vw:", long_options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hi:l:L:mp:P:r:s:t:u:v:Vw:", long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'a': AudioCommand = optarg;
|
||||
break;
|
||||
@ -268,6 +269,13 @@ int main(int argc, char *argv[])
|
||||
break;
|
||||
case 'h': DisplayHelp = true;
|
||||
break;
|
||||
case 'i': if (isnumber(optarg)) {
|
||||
InstanceId = atoi(optarg);
|
||||
if (InstanceId >= 0)
|
||||
break;
|
||||
}
|
||||
fprintf(stderr, "vdr: invalid instance id: %s\n", optarg);
|
||||
return 2;
|
||||
case 'l': {
|
||||
char *p = strchr(optarg, '.');
|
||||
if (p)
|
||||
|
Loading…
Reference in New Issue
Block a user