Version 1.0.0pre5

- Fixed restoring CICAM setup values for a fourth DVB card (thanks to Klaus Wolf).
- Completed internationalization of OSD texts (thanks to Hannu Savolainen,
  Arnold Niessen, Paulo Lopes, Jean-Claude Repetto, Alberto Carraro, Matjaz
  Thaler and Truls Slevigen).
- Improved file I/O in case of EINTR, which may occur e.g. with heavy system
  load (thanks to Werner Fink).
- Now writing the title of a recording into the 'summary.vdr' file.
- Workaround for displaying still frames with the unpatched LinuxDVB driver
  (if anybody ever finds out why the unpatched driver doesn't display VDR's
  still frames, please let me know).
- When executing a command from the "Commands" menu, the title of that command
  is now immediately shown in the status line (followed by "...") to give the
  user some feedback that the command is being executed, which is especially
  important if this takes some time.
- Fixed scrolling the "Channels" menu in case the cursor ends up on a group
  delimiter (thanks to Bernd Zierath for helping to debug this one).
- Added manual pages vdr(1) and vdr(5) (which made the FORMATS file obsolete).
- New command command line option '-V' to display the VDR version.
- Adjusting column width for channel numbers in case there are more than 999
  channels.
- Checking the return value of '...FileRady...' calls in dvbapi.c for better
  performance under heavy system load.
- New 'make' target 'install', which copies the manual pages and executables
  to their appropriate system locations and creates the /video directory if
  it doesn't exist yet.
- Automatic hotkey assignment is now suppressed if the first entry in
  commands.conf starts with a digit in the range '1'...'9', followed by a blank.
- Fixed a bug in switching back the replay mode display in time shift mode
  (thanks to Achim Lange for reporting this one).
- Fixed a bug in the 'First day' timer parameter for timers that record over
  midnight.
- Added units to Setup parameters.
- Changed time entry in the 'Jump' command during replay, so that it is filled
  up from right to left.
- Now using statfs() to determine the amount of free disk space, which avoids
  the use of an external 'df' command (thanks to Ruben Nunez Francisco).
- Fixed skipping the next hit of a repeating timer (thanks to Rainer Zocholl
  for reporting this one).
- Fixed a bug when a timer records over midnight of a day that had a change in
  Daylight Saving Time.
- Added Polish language texts (thanks to Michael Rakowski).
- Fixed a bug in parsing group separators in channels.conf (thanks to Henning
  Holtschneider for reporting this one).
- Changed the default 'Ok' key when using the PC keyboard from '5' (in the
  numeric block) to 'Enter', because the '5' key didn't work on keyboards with
  the F-keys on top.
- Fixed a bug in the EPG bugfix mechanism if the extended description is shorter
  than 3 characters (thanks to Andreas Schultz).
This commit is contained in:
Klaus Schmidinger 2002-04-01 18:00:00 +02:00
parent 217fcb2680
commit 262327908d
23 changed files with 1649 additions and 969 deletions

View File

@ -51,10 +51,10 @@ Matthias Schniedermeyer <ms@citd.de>
for helping to debug the "move to last position in list" bug
Miha Setina <mihasetina@softhome.net>
for translating the OSD texts to the Slovenian language
for translating OSD texts to the Slovenian language
Alberto Carraro <bertocar@tin.it>
for translating the OSD texts to the Italian language
for translating OSD texts to the Italian language
Deti Fliegl <deti@fliegl.de>
for implementing the 'CurrentChannel' setup parameter
@ -77,7 +77,7 @@ Axel Gruber <axel@agm.de>
for his support in keeping the Premiere World channels up to date in 'channels.conf'
Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>
for translating the OSD texts to the Dutch language
for translating OSD texts to the Dutch language
Jürgen Sauer <jojo@automatix.de>
for implementing the -t option to set the controlling terminal
@ -87,9 +87,10 @@ Benjamin Reichardt <reichard@math.uni-goettingen.de>
Henning Holtschneider <hh@holtschneider.com>
for patching 'runvdr' to check whether the driver is already loaded
for reporting a bug in parsing group separators in channels.conf
Paulo Manuel Martins Lopes <pmml@netvita.pt>
for translating the OSD texts to the Portugese language
Paulo Lopes <pmml@netvita.pt>
for translating OSD texts to the Portugese language
Markus Lang <pretender@gaze.de> and Ulrich Röder <dynamite@efr-net.de>
for making DiSEqC support configurable
@ -98,13 +99,13 @@ Markus Lang <pretender@gaze.de>
for some initial code for grouping the Setup menu into several sub-menus
Jean-Claude Repetto <jc@repetto.org>
for translating the OSD texts to the French language
for translating OSD texts to the French language
Andre Valentin <av2000@topmail.de>
for increasing the key name buffer size for LIRC
Jørgen Tvedt <pjtvedt@online.no>
for translating the OSD texts to the Norwegian language
for translating OSD texts to the Norwegian language
Stefan Huelswitt <huels@iname.com>
for fixing the repeat function with LIRC
@ -129,6 +130,8 @@ Andreas Schultz <aschultz@warp10.net>
dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>)
for adding PTS to the converted PCM audio when replaying a DVD
for fixing a crash in case there is no 'epg.data' at program start
for fixing a bug in the EPG bugfix mechanism if the extended description is shorter
than 3 characters
Aaron Holtzman
for writing 'ac3dec'
@ -141,6 +144,7 @@ Uwe Scheffler <UweScheffler@t-online.de>
Matjaz Thaler <matjaz.thaler@guest.arnes.si>
for improving AC3 decoding when replaying DVDs
for translating OSD texts to the Slovenian language
Artur Skawina <skawina@geocities.com>
for improving the font file generation in the Makefile
@ -205,7 +209,7 @@ Michael Paar <mpaar@uumail.de>
for enabling recording of radio channels
Hannu Savolainen <hannu@opensound.com>
for translating the OSD texts to the Finnish language
for translating OSD texts to the Finnish language
Jürgen Schmidt <ju@ct.heise.de>
for fixing a problem with 'in_addr_t' on systems with glibc < 2.2.
@ -214,9 +218,10 @@ Uwe Freese <mail@uwe-freese.de>
for suggesting to automatically close an empty recordings page after deleting
an entry
Rainer Zocholl <Usenet-372114@zocki.toppoint.de>
Rainer Zocholl <vdrcontrib@zocki.toppoint.de>
for suggesting a confirmation prompt when the user presses the "Power" button
and there is an upcoming timer event
for reporting a bug in skipping the next hit of a repeating timer
Oleg Assovski <assen@bitcom.msk.ru>
for adding EPG scanning for another 4 days
@ -233,3 +238,20 @@ Mirko G
Achim Lange <Achim_Lange@t-online.de>
for replacing 'killproc' with 'killall' in 'runvdr' to make it work on Debian
for reporting a bug in switching back the replay mode display in time shift mode
Klaus Wolf <klaus@wolfsoft.de>
for reporting a bug in restoring the CICAM values for a fourth DVB card
Bernd Zierath <b.zierath@ebv.com>
for helping to debug scrolling the "Channels" menu in case the cursor ends up on
a group separator
Truls Slevigen <truls@slevigen.no>
for translating OSD texts to the Norwegian language
Ruben Nunez Francisco <ruben.nunez@tang-it.com>
for implementing FreeDiskSpaceMB() without external 'df' command
Michael Rakowski <mrak@gmx.de>
for translating OSD texts to the Polish language

227
FORMATS
View File

@ -1,227 +0,0 @@
Video Disk Recorder File Formats
--------------------------------
* channels.conf
This file contains the channel setup.
It consists of two types of lines: "group delimiters" and "channel
definitions".
A "group delimiter" is a line starting with a ':' as the very first
character, followed by arbitrary text.
Example: ":First group"
A "channel definition" is a line with channel data, where the fields
are separated by ':' characters:
Example: "RTL:12188:h:1:27500:163:104:105:0:12003"
The fields in a channel definition have the following meaning (from left
to right):
- Name: the channel's name (if the name originally contains a ':' character
it has to be replaced by '|')
- Frequency in MHz for DVB-S and DVB-C, kHz for DVB-T (as an integer)
- Polarization (one of 'h', 'H', 'v', 'V') **
- Diseqc number **
- Symbol rate ***
- Video PID (set to '0' for radio channels, '1' for encrypted radio channels)
- Audio PID (either one number, or two, separated by a comma)
If this channel also carries Dolby Digital sound, the Dolby PIDs follow
the audio PIDs, separated by a semicolon, as in "...:101,102;103,104:..."
- Teletext PID
- Conditional Access (0 = Free To Air, 1..4 = explicitly requires the DVB card
with the given number, >=100 = requires a specific decryption method defined
in 'ca.conf').
- Program Number
Fields marked with ** are only meaningful for DVB-S receivers.
DVB-C and DVB-T receivers simply ignore these.
Fields marked with *** are only meaningful for DVB-S and DVB-C receivers.
DVB-T receivers simply ignore these.
* ca.conf
This file contains the definitions of the various conditional access code
numbers. Anything after (and including) a '#' character is comment.
Value lines consist of an integer number, followed by a text describing
this decryption method (typically the name of the pay tv service using this
decryption method).
The special value 0 means "Free To Air", i.e. can be used for channels that
don't require additional decryption hardware.
The values 1..4 can be used for channels that for some reason explicitly
need a given DVB card (for backward compatibility).
The values defined in this file are the ones used in the 'Ca' parameter of
'channels.conf'.
* timers.conf
This file contains the timer setup.
The fields in a timer definition have the following meaning (from left
to right):
- Timer active (0 = inactive, 1 = active, 3 = instant recording)
Values other than these can be used by external programs to mark active timers
and recognize if the user has modified them. When a user modifes an active
timer the 'active' field will be explicitly set to '1' (or '0', respectively,
if the user deactivates the timer).
Note: in order to allow future extensibility, external programs using the
'active' parameter should only use the upper 16 bit of this 32 bit parameter
and leave the lower 16 bit untouched.
- Program number of the channel to record
- Day of recording (in case of a repeating timer), either one or more of
M------ = Monday
-T----- = Tuesday
--W---- = Wednesday
---T--- = Thrusday
----F-- = Friday
-----S- = Saturday
------S = Sunday
(any combination is possible, for example MTWTF--, and the days may be
indicated by any characters except '-', so for example ABC---- would set
a timer that records on monday, tuesday and wednesday) or the "day of month"
(1..31) in case of a single shot timer.
The day definition of a repeating timer may be followed by the date when that
timer shall hit for the first time. The format for this is @YYYY-MM-DD,
so a complete definition could look like this: MTWTF--@2002-02-18. This
"first day" feature can be used to disable a repeating timer for a couple
of days, or for instance to define a new Mon...Fri timer on wednesday, which
actually starts "monday next week". The "first day" date given need not be
that of a day when the timer would actually hit.
- Start time (first two digits for the hour, second two digits for the minutes)
- End time (first two digits for the hour, second two digits for the minutes)
- Priority (from 0 to 99, 0 = lowest prioity, 99 = highest priority)
- Guaranteed lifetime of recording (in days); 0 means that this recording may
be automatically deleted by a new recording with higher priority, 99 means
that this recording will never be automatically deleted
- Name of timer (will be used to name the recording); if the name contains
any ':' characters, these have to be replaced with '|'. If the name shall
contain subdirectories, these have to be delimited by '~' (since the '/'
character may be part of a regular programme name).
The special keywords TITLE and EPISODE, if present, will be replaced
with the title and episode information from the EPG data at the time of
recording (if that data is available). If at the time of recording either
of these cannot be determined, TITLE will default to the channel name, and
EPISODE will default to a blank.
- Summary (any newline characters in the summary have to be replaced with '|';
the summary may contain ':' characters)
* setup.conf
This file contains the basic configuration options for VDR.
Each line contains one option in the format "Name = Value".
See the MANUAL file for a description of the available options.
* commands.conf
This file contains the definitions of commands that can be executed from
the "VDR" menu's "Commands" option.
Each line contains one command definition in the following format:
title : command
where 'title' is the string the will be displayed in the "Commands" menu,
and 'command' is the actual command string that will be executed when this
option is selected. The delimiting ':' may be surrounded by any number of
white space characters.
In order to avoid error messages to stderr, every command should have
stderr redirected to stdout. Everything the command prints to stdout will
be displayed in a result window, with 'title' as its title.
Examples:
Check for new mail: /usr/local/bin/checkmail 2>&1
CPU status : /usr/local/bin/cpustatus 2>&1
Disk space : df -h | grep '/video' | awk '{ print 100 - $5 "% free"; }'
* svdrphosts.conf
This file contains the IP numbers of all hosts that are allowed to access the
SVDRP port.
Each line contains one IP number in the format
IP-Address[/Netmask]
where 'IP-Address' is the address of a host or a network in the usual dot
separated notation (as in 192.168.100.1). If the optional 'Netmask' is given
only the given number of bits of 'IP-Address' are taken into account. This
allows you to grant SVDRP access to all hosts of an entire network. 'Netmask'
can be any integer from 1 to 32. The special value of 0 is only accepted if
the 'IP-Address' is 0.0.0.0, because this will give access to any host (USE
THIS WITH CARE!).
Everything following (and including) a '#' character is considered to be
comment.
* marks.vdr
This file (if present in a recording directory) contains the editing marks
defined for this recording.
Each line contains the definition of one mark in the following format:
hh:mm:ss.ff comment
where 'hh:mm:ss.ff' is a frame position within the recording, given as "hours,
minutes, seconds and (optional) frame number". 'comment' can be any string
and may be used to describe this mark. If present, 'comment' must be separated
from the frame position by at least one blank.
The lines in this file need not necessarily appear in the correct temporal
sequence, they will be automatically sorted by time index.
CURRENT RESTRICTIONS:
- the 'comment' is currently not used by VDR
- marks must have a frame number, and that frame MUST be an I-frame (this
means that only marks generated by VDR itself can be used, since they
will always be guaranteed to mark I-frames).
* 001.vdr ... 255.vdr
These are the actual recorded MPEG data files. In order to keep the size of
an individual file below a given limit, a recording is split into several
files. The contents of these files is "Packetized Elementary Stream" (PES)
and contains ES packets with ids 0xE0 for video, 0xC0 for audio 1 and 0xC1
for audio 2 (if available). Dolby Digital data is stored in packets with
ids 0xBD.
* epg.data
This file contains the EPG data in an easily parsable format. The first
character of each line defines what kind of data this line contains.
The following tag characters are defined:
C <service id> <channel name>
E <event id> <start time> <duration> <table id>
T <title>
S <subtitle>
D <description>
e
c
Lowercase characters mark the end of a sequence that was started by the
corresponding uppercase character. The outer frame consists of a sequence
of one or more 'C'...'c' (Channel) entries. Inside these any number of
'E'...'e' (Event) entries are allowed. The 'T', 'S' and 'D' entries are
optional (although every event should at least have a 'T' entry).
<service id> is the "program number" as defined in 'channels.conf'
<channel name> is the "name" as in 'channels.conf' (for information only)
<start time> is the time (as a time_t integer) in UTC when this event starts
<duration> is the time (in seconds) that this event will take
<table id> is a hex number that indicates the table this event is contained
in (if this is left empty or 0 this event will not be overwritten
or modified by data that comes from the DVB stream)
<title> is the title of the event
<subtitle> is the subtitle (typically the name of the episode etc.)
<description> is the description of the event
This file will be read at program startup in order to restore the results of
previous EPG scans.

53
HISTORY
View File

@ -529,7 +529,7 @@ Video Disk Recorder Revision History
2001-06-26: Version 0.83
- Avoiding "Device or resource busy" error message when setting PIDs.
- Added Portugese language texts (thanks to Paulo Manuel Martins Lopes).
- Added Portugese language texts (thanks to Paulo Lopes).
- Recording and replaying Dolby Digital (AC3) sound.
- No longer getting stuck when a channel doesn't sync while switching
with the 'Up' and 'Down' keys.
@ -1119,3 +1119,54 @@ Video Disk Recorder Revision History
driver are wrapped into a mechanism that actually performs this action if VDR
exits. The 'runvdr' script can be used for this purpose.
- Refined texts of the "Setup" menu.
2002-04-01: Version 1.0.0pre5
- Fixed restoring CICAM setup values for a fourth DVB card (thanks to Klaus Wolf).
- Completed internationalization of OSD texts (thanks to Hannu Savolainen,
Arnold Niessen, Paulo Lopes, Jean-Claude Repetto, Alberto Carraro, Matjaz
Thaler and Truls Slevigen).
- Improved file I/O in case of EINTR, which may occur e.g. with heavy system
load (thanks to Werner Fink).
- Now writing the title of a recording into the 'summary.vdr' file.
- Workaround for displaying still frames with the unpatched LinuxDVB driver
(if anybody ever finds out why the unpatched driver doesn't display VDR's
still frames, please let me know).
- When executing a command from the "Commands" menu, the title of that command
is now immediately shown in the status line (followed by "...") to give the
user some feedback that the command is being executed, which is especially
important if this takes some time.
- Fixed scrolling the "Channels" menu in case the cursor ends up on a group
delimiter (thanks to Bernd Zierath for helping to debug this one).
- Added manual pages vdr(1) and vdr(5) (which made the FORMATS file obsolete).
- New command command line option '-V' to display the VDR version.
- Adjusting column width for channel numbers in case there are more than 999
channels.
- Checking the return value of '...FileRady...' calls in dvbapi.c for better
performance under heavy system load.
- New 'make' target 'install', which copies the manual pages and executables
to their appropriate system locations and creates the /video directory if
it doesn't exist yet.
- Automatic hotkey assignment is now suppressed if the first entry in
commands.conf starts with a digit in the range '1'...'9', followed by a blank.
- Fixed a bug in switching back the replay mode display in time shift mode
(thanks to Achim Lange for reporting this one).
- Fixed a bug in the 'First day' timer parameter for timers that record over
midnight.
- Added units to Setup parameters.
- Changed time entry in the 'Jump' command during replay, so that it is filled
up from right to left.
- Now using statfs() to determine the amount of free disk space, which avoids
the use of an external 'df' command (thanks to Ruben Nunez Francisco).
- Fixed skipping the next hit of a repeating timer (thanks to Rainer Zocholl
for reporting this one).
- Fixed a bug when a timer records over midnight of a day that had a change in
Daylight Saving Time.
- Added Polish language texts (thanks to Michael Rakowski).
- Fixed a bug in parsing group separators in channels.conf (thanks to Henning
Holtschneider for reporting this one).
- Changed the default 'Ok' key when using the PC keyboard from '5' (in the
numeric block) to 'Enter', because the '5' key didn't work on keyboards with
the F-keys on top.
- Fixed a bug in the EPG bugfix mechanism if the extended description is shorter
than 3 characters (thanks to Andreas Schultz).

12
INSTALL
View File

@ -78,6 +78,8 @@ option to set the controlling terminal, as in
vdr:123:respawn:/usr/local/bin/vdr --terminal=/dev/tty8 -w 60
See the man page vdr(1) for complete information about all command line options.
Locale
------
@ -279,17 +281,15 @@ with the name of the basic directory when running 'vdr':
Configuration files:
--------------------
There are three configuration files that hold information about
channels, remote control keys and timers. By default these files are
There are several configuration files that hold information about
channels, remote control keys, timers etc. By default these files are
assumed to be located in the video directory, but a different directory
can be used with the '-c' option. For starters just copy all *.conf files from
the VDR directory into your video directory.
The configuration files can be edited with any text editor, or will be written
by the 'vdr' program if any changes are made inside the on-screen menus.
The meaning of the data entries may still vary in future releases, so for the
moment please look at the source code (config.c) to see the meaning of the
various fields.
Take a look at man page vdr(5) for information about the file formats.
The files that come with this package contain the author's selections,
so please make sure you adapt these to your personal taste. Also make sure
@ -350,7 +350,7 @@ The default PC key assignments are:
Up, Down, Left, Right Crsr keys in numeric block
Menu 'Home' in numeric block
Ok '5' in numeric block
Ok 'Enter'
Back 'End' in numeric block
Red, Green, Yellow, Blue 'F1'..'F4'
0..9 '0'..'9' in top row

View File

@ -4,12 +4,16 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 1.31 2002/02/24 12:29:54 kls Exp $
# $Id: Makefile 1.33 2002/04/01 12:50:48 kls Exp $
.DELETE_ON_ERROR:
DVBDIR = ../DVB
DTVDIR = ./libdtv
MANDIR = /usr/local/man
BINDIR = /usr/local/bin
VIDEODIR = /video
INCLUDES = -I$(DVBDIR)/ost/include
@ -84,6 +88,17 @@ genfontfile: genfontfile.c
$(DTVLIB) $(DTVDIR)/libdtv.h:
make -C $(DTVDIR) all
# Install the files:
install:
@cp vdr runvdr $(BINDIR)
@gzip -c vdr.1 > $(MANDIR)/man1/vdr.1.gz
@gzip -c vdr.5 > $(MANDIR)/man5/vdr.5.gz
@if [ ! -d $(VIDEODIR) ]; then\
mkdir $(VIDEODIR);\
cp *.conf $(VIDEODIR);\
fi
# Housekeeping:
clean:

8
README
View File

@ -31,11 +31,3 @@ file management and even "on disk editing". The menus
of commercial set-top-boxes usually are a lot more fancy than
the ones in this system, but here we have the full source code
and can modify the menus in whatever way desired.
What do you think?
------------------
So, what do you think about this project? Does it make sense? Were you
able to use it? Do you have suggestions on how to improve it?
Please send email to kls@cadsoft.de if you'd like to comment on this.

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.91 2002/03/17 14:24:09 kls Exp $
* $Id: config.c 1.96 2002/04/01 11:54:05 kls Exp $
*/
#include "config.h"
@ -248,6 +248,7 @@ bool cChannel::Parse(const char *s)
strn0cpy(name, s, MaxChannelName);
name[strlen(name) - 1] = 0; // strip the '\n'
groupSep = true;
number = 0;
}
else
return false;
@ -439,6 +440,7 @@ int cTimer::ParseDay(const char *s, time_t *FirstDay)
tm_r.tm_year -= 1900;
tm_r.tm_mon--;
tm_r.tm_hour = tm_r.tm_min = tm_r.tm_sec = 0;
tm_r.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
*FirstDay = mktime(&tm_r);
}
}
@ -560,6 +562,7 @@ time_t cTimer::IncDay(time_t t, int Days)
tm tm = *localtime_r(&t, &tm_r);
tm.tm_mday += Days; // now tm_mday may be out of its valid range
int h = tm.tm_hour; // save original hour to compensate for DST change
tm.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
t = mktime(&tm); // normalize all values
tm.tm_hour = h; // compensate for DST change
return mktime(&tm); // calculate final result
@ -572,6 +575,7 @@ time_t cTimer::SetTime(time_t t, int SecondsFromMidnight)
tm.tm_hour = SecondsFromMidnight / 3600;
tm.tm_min = (SecondsFromMidnight % 3600) / 60;
tm.tm_sec = SecondsFromMidnight % 60;
tm.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
return mktime(&tm);
}
@ -602,7 +606,7 @@ bool cTimer::Matches(time_t t)
if ((!firstday || a >= firstday) && t <= b) {
startTime = a;
stopTime = b;
if (t >= firstday)
if (t >= firstday + SECSINDAY)
firstday = 0;
break;
}
@ -638,9 +642,9 @@ void cTimer::SetPending(bool Pending)
pending = Pending;
}
void cTimer::SkipToday(void)
void cTimer::Skip(void)
{
firstday = IncDay(SetTime(recording ? StartTime() : time(NULL), 0), 1);
firstday = IncDay(SetTime(StartTime(), 0), 1);
}
// --- cCommand -------------------------------------------------------------
@ -980,7 +984,7 @@ bool cSetup::ParseCaCaps(const char *Value)
{
char *p;
int d = strtol(Value, &p, 10);
if (d > 0 && d < MAXDVBAPI) {
if (d > 0 && d <= MAXDVBAPI) {
d--;
int i = 0;
while (p != Value && p && *p) {

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.105 2002/03/17 14:24:11 kls Exp $
* $Id: config.h 1.107 2002/03/31 21:17:30 kls Exp $
*/
#ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h"
#include "tools.h"
#define VDRVERSION "1.0.0pre4"
#define VDRVERSION "1.0.0pre5"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
@ -165,7 +165,7 @@ public:
time_t StopTime(void);
void SetRecording(bool Recording);
void SetPending(bool Pending);
void SkipToday(void);
void Skip(void);
const char *PrintFirstDay(void);
static int TimeToInt(int t);
static int ParseDay(const char *s, time_t *FirstDay = NULL);

162
dvbapi.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.c 1.163 2002/03/16 14:20:47 kls Exp $
* $Id: dvbapi.c 1.166 2002/03/29 11:32:47 kls Exp $
*/
#include "dvbapi.h"
@ -98,7 +98,7 @@ class cIndexFile {
private:
struct tIndex { int offset; uchar type; uchar number; short reserved; };
int f;
char *fileName, *pFileExt;
char *fileName;
int size, last;
tIndex *index;
cResumeFile resumeFile;
@ -120,7 +120,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
:resumeFile(FileName)
{
f = -1;
fileName = pFileExt = NULL;
fileName = NULL;
size = 0;
last = -1;
index = NULL;
@ -128,7 +128,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
fileName = new char[strlen(FileName) + strlen(INDEXFILESUFFIX) + 1];
if (fileName) {
strcpy(fileName, FileName);
pFileExt = fileName + strlen(fileName);
char *pFileExt = fileName + strlen(fileName);
strcpy(pFileExt, INDEXFILESUFFIX);
int delta = 0;
if (access(fileName, R_OK) == 0) {
@ -177,8 +177,6 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
}
else
LOG_ERROR_STR(fileName);
delete fileName;
fileName = pFileExt = NULL;
}
}
else
@ -223,14 +221,14 @@ bool cIndexFile::CatchUp(int Index)
last = newLast;
}
else
LOG_ERROR;
LOG_ERROR_STR(fileName);
}
else
esyslog(LOG_ERR, "ERROR: can't realloc() index");
}
}
else
LOG_ERROR;
LOG_ERROR_STR(fileName);
if (Index >= last)
sleep(1);
else
@ -244,8 +242,8 @@ bool cIndexFile::Write(uchar PictureType, uchar FileNumber, int FileOffset)
{
if (f >= 0) {
tIndex i = { FileOffset, PictureType, FileNumber, 0 };
if (safe_write(f, &i, sizeof(i)) != sizeof(i)) {
esyslog(LOG_ERR, "ERROR: can't write to index file");
if (safe_write(f, &i, sizeof(i)) < 0) {
LOG_ERROR_STR(fileName);
close(f);
f = -1;
return false;
@ -527,23 +525,25 @@ void cRecordBuffer::Input(void)
time_t t = time(NULL);
recording = true;
for (;;) {
int r = read(videoDev, b, sizeof(b));
if (r > 0) {
uchar *p = b;
while (r > 0) {
int w = Put(p, r);
p += w;
r -= w;
}
t = time(NULL);
}
else if (r < 0) {
if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else {
LOG_ERROR;
break;
if (cFile::FileReady(videoDev, 100)) {
int r = read(videoDev, b, sizeof(b));
if (r > 0) {
uchar *p = b;
while (r > 0) {
int w = Put(p, r);
p += w;
r -= w;
}
t = time(NULL);
}
else if (r < 0) {
if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else {
LOG_ERROR;
break;
}
}
}
}
@ -552,7 +552,6 @@ void cRecordBuffer::Input(void)
cThread::EmergencyExit(true);
t = time(NULL);
}
cFile::FileReady(videoDev, 100);
if (!recording)
break;
}
@ -579,17 +578,12 @@ void cRecordBuffer::Output(void)
if (NextFile()) {
if (index && pictureType != NO_PICTURE)
index->Write(pictureType, fileName.Number(), fileSize);
while (Result > 0) {
int w = safe_write(recordFile, p, Result);
if (w < 0) {
LOG_ERROR_STR(fileName.Name());
recording = false;
return;
}
p += w;
Result -= w;
fileSize += w;
}
if (safe_write(recordFile, p, Result) < 0) {
LOG_ERROR_STR(fileName.Name());
recording = false;
return;
}
fileSize += Result;
}
else
break;
@ -797,16 +791,17 @@ void cPlayBuffer::Output(void)
const uchar *p = frame->Data();
int r = frame->Count();
while (r > 0 && Busy() && !blockOutput) {
cFile::FileReadyForWriting(videoDev, 100);
int w = write(videoDev, p, r);
if (w > 0) {
p += w;
r -= w;
}
else if (w < 0 && FATALERRNO) {
LOG_ERROR;
Stop();
return;
if (cFile::FileReadyForWriting(videoDev, 100)) {
int w = write(videoDev, p, r);
if (w > 0) {
p += w;
r -= w;
}
else if (w < 0 && FATALERRNO) {
LOG_ERROR;
Stop();
return;
}
}
}
writeIndex = frame->Index();
@ -1182,10 +1177,26 @@ void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except)
void cReplayBuffer::DisplayFrame(uchar *b, int Length)
{
StripAudioPackets(b, Length);
videoDisplayStillPicture sp = { (char *)b, Length };
CHECK(ioctl(audioDev, AUDIO_SET_AV_SYNC, false));
CHECK(ioctl(audioDev, AUDIO_SET_MUTE, true));
/* Using the VIDEO_STILLPICTURE ioctl call would be the
correct way to display a still frame, but unfortunately this
doesn't work with frames from VDR. So let's do pretty much the
same here as in DVB/driver/dvb.c's play_iframe() - I have absolutely
no idea why it works this way, but doesn't work with VIDEO_STILLPICTURE.
If anybody ever finds out what could be changed so that VIDEO_STILLPICTURE
could be used, please let me know!
kls 2002-03-23
*/
//#define VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
#ifdef VIDEO_STILLPICTURE_WORKS_WITH_VDR_FRAMES
videoDisplayStillPicture sp = { (char *)b, Length };
CHECK(ioctl(videoDev, VIDEO_STILLPICTURE, &sp));
#else
#define MIN_IFRAME 400000
for (int i = MIN_IFRAME / Length + 1; i > 0; i--)
safe_write(videoDev, b, Length);
#endif
}
void cReplayBuffer::Close(void)
@ -1361,31 +1372,32 @@ void cTransferBuffer::Input(void)
uchar b[MINVIDEODATA];
int n = 0;
while (Busy()) {
cFile::FileReady(fromDevice, 100);
int r = read(fromDevice, b + n, sizeof(b) - n);
if (r > 0) {
n += r;
int Count = n, Result;
const uchar *p = remux.Process(b, Count, Result);
if (p) {
while (Result > 0 && Busy()) {
int w = Put(p, Result);
p += w;
Result -= w;
if (cFile::FileReady(fromDevice, 100)) {
int r = read(fromDevice, b + n, sizeof(b) - n);
if (r > 0) {
n += r;
int Count = n, Result;
const uchar *p = remux.Process(b, Count, Result);
if (p) {
while (Result > 0 && Busy()) {
int w = Put(p, Result);
p += w;
Result -= w;
}
}
if (Count > 0) {
n -= Count;
memmove(b, b + Count, n);
}
}
else if (r < 0) {
if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else {
LOG_ERROR;
break;
}
}
if (Count > 0) {
n -= Count;
memmove(b, b + Count, n);
}
}
else if (r < 0) {
if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else {
LOG_ERROR;
break;
}
}
}
@ -1541,7 +1553,7 @@ void cCuttingBuffer::Action(void)
}
LastIFrame = 0;
}
if (safe_write(toFile, buffer, Length) != Length) {
if (safe_write(toFile, buffer, Length) < 0) {
error = "safe_write";
break;
}

6
eit.c
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: eit.c 1.41 2002/03/17 14:23:41 kls Exp $
* $Id: eit.c 1.42 2002/04/01 12:58:20 kls Exp $
***************************************************************************/
#include "eit.h"
@ -560,8 +560,8 @@ void cEventInfo::FixEpgBugs(void)
pExtendedDescription = compactspace(pExtendedDescription);
// Remove superfluous hyphens:
if (pExtendedDescription) {
char *p = pExtendedDescription + 1;
while (*p) {
char *p = pExtendedDescription;
while (*p && *(p + 1) && *(p + 2)) {
if (*p == '-' && *(p + 1) == ' ' && *(p + 2) && islower(*(p - 1)) && islower(*(p + 2))) {
if (!startswith(p + 2, "und ")) { // special case in German, as in "Lach- und Sachgeschichten"
memmove(p, p + 2, strlen(p + 2) + 1);

25
eit.diff Normal file
View File

@ -0,0 +1,25 @@
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux VDR
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.21 -> 1.22
# eit.c 1.6 -> 1.7
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/01 aschultz@warp10.net 1.22
# fix segfault in eit.c
# --------------------------------------------
#
diff -Nru a/eit.c b/eit.c
--- a/eit.c Mon Apr 1 14:38:00 2002
+++ b/eit.c Mon Apr 1 14:38:00 2002
@@ -559,7 +559,7 @@
pSubtitle = compactspace(pSubtitle);
pExtendedDescription = compactspace(pExtendedDescription);
// Remove superfluous hyphens:
- if (pExtendedDescription) {
+ if (pExtendedDescription && strlen(pExtendedDescription) >= 3) {
char *p = pExtendedDescription + 1;
while (*p) {
if (*p == '-' && *(p + 1) == ' ' && *(p + 2) && islower(*(p - 1)) && islower(*(p + 2))) {

1189
i18n.c

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ Address 0000
Up 00000103
Down 00000102
Menu 00000106
Ok 0000015E
Ok 0000000D
Back 00000168
Left 00000104
Right 00000105

141
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 1.172 2002/03/17 14:23:44 kls Exp $
* $Id: menu.c 1.180 2002/03/31 21:17:42 kls Exp $
*/
#include "menu.h"
@ -21,6 +21,8 @@
#define MAXWAIT4EPGINFO 10 // seconds
#define MODETIMEOUT 3 // seconds
#define CHNUMWIDTH (Channels.Count() > 999 ? 5 : 4) // there are people with more than 999 channels...
const char *FileNameChars = " aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-.#~^";
// --- cMenuEditItem ---------------------------------------------------------
@ -780,7 +782,7 @@ public:
};
cMenuChannels::cMenuChannels(void)
:cOsdMenu(tr("Channels"), 4)
:cOsdMenu(tr("Channels"), CHNUMWIDTH)
{
//TODO
int i = 0;
@ -1186,7 +1188,7 @@ public:
};
cMenuTimers::cMenuTimers(void)
:cOsdMenu(tr("Timers"), 2, 4, 10, 6, 6)
:cOsdMenu(tr("Timers"), 2, CHNUMWIDTH, 10, 6, 6)
{
int i = 0;
cTimer *timer;
@ -1217,7 +1219,7 @@ eOSState cMenuTimers::OnOff(void)
timer->active = false;
}
else if (timer->active)
timer->SkipToday();
timer->Skip();
else
timer->active = true;
timer->Matches(); // refresh start and end time
@ -1412,7 +1414,7 @@ static int CompareEventChannel(const void *p1, const void *p2)
}
cMenuWhatsOn::cMenuWhatsOn(const cSchedules *Schedules, bool Now, int CurrentChannelNr)
:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), 4, 7, 6)
:cOsdMenu(Now ? tr("What's on now?") : tr("What's on next?"), CHNUMWIDTH, 7, 6)
{
const cSchedule *Schedule = Schedules->First();
const cEventInfo **pArray = NULL;
@ -1854,7 +1856,7 @@ eOSState cMenuRecordings::Del(void)
if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
cTimer *timer = rc->Timer();
if (timer) {
timer->SkipToday();
timer->Skip();
cRecordControls::Process(time(NULL));
Timers.Save();
}
@ -1935,7 +1937,7 @@ public:
};
cMenuSetupPage::cMenuSetupPage(void)
:cOsdMenu("", 30)
:cOsdMenu("", 33)
{
data = Setup;
osdLanguage = Setup.OSDLanguage;
@ -1991,7 +1993,7 @@ void cMenuSetupOSD::Set(void)
Add(new cMenuEditStraItem(tr("Setup.OSD$Language"), &data.OSDLanguage, NumLanguages, Languages()));
Add(new cMenuEditIntItem( tr("Setup.OSD$Width"), &data.OSDwidth, MINOSDWIDTH, MAXOSDWIDTH));
Add(new cMenuEditIntItem( tr("Setup.OSD$Height"), &data.OSDheight, MINOSDHEIGHT, MAXOSDHEIGHT));
Add(new cMenuEditIntItem( tr("Setup.OSD$Message time"), &data.OSDMessageTime, 1, 60));
Add(new cMenuEditIntItem( tr("Setup.OSD$Message time (s)"), &data.OSDMessageTime, 1, 60));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Channel info position"), &data.ChannelInfoPos, tr("bottom"), tr("top")));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Info on channel switch"), &data.ShowInfoOnChSwitch));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Scroll pages"), &data.MenuScrollPage));
@ -2012,7 +2014,7 @@ void cMenuSetupEPG::Set(void)
{
Clear();
SetupTitle("EPG");
Add(new cMenuEditIntItem( tr("Setup.EPG$EPG scan timeout"), &data.EPGScanTimeout));
Add(new cMenuEditIntItem( tr("Setup.EPG$EPG scan timeout (h)"), &data.EPGScanTimeout));
Add(new cMenuEditIntItem( tr("Setup.EPG$EPG bugfix level"), &data.EPGBugfixLevel, 0, MAXEPGBUGFIXLEVEL));
Add(new cMenuEditBoolItem(tr("Setup.EPG$Set system time"), &data.SetSystemTime));
Add(new cMenuEditTranItem(tr("Setup.EPG$Use time from transponder"), &data.TimeTransponder));
@ -2048,10 +2050,10 @@ void cMenuSetupLNB::Set(void)
{
Clear();
SetupTitle("LNB");
Add(new cMenuEditIntItem( tr("Setup.LNB$SLOF"), &data.LnbSLOF));
Add(new cMenuEditIntItem( tr("Setup.LNB$Low LNB frequency"), &data.LnbFrequLo));
Add(new cMenuEditIntItem( tr("Setup.LNB$High LNB frequency"), &data.LnbFrequHi));
Add(new cMenuEditBoolItem(tr("Setup.LNB$Use DiSEqC"), &data.DiSEqC));
Add(new cMenuEditIntItem( tr("Setup.LNB$SLOF (MHz)"), &data.LnbSLOF));
Add(new cMenuEditIntItem( tr("Setup.LNB$Low LNB frequency (MHz)"), &data.LnbFrequLo));
Add(new cMenuEditIntItem( tr("Setup.LNB$High LNB frequency (MHz)"), &data.LnbFrequHi));
Add(new cMenuEditBoolItem(tr("Setup.LNB$Use DiSEqC"), &data.DiSEqC));
}
// --- cMenuSetupCICAM -------------------------------------------------------
@ -2089,17 +2091,17 @@ void cMenuSetupRecord::Set(void)
{
Clear();
SetupTitle("Recording");
Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at start"), &data.MarginStart));
Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at stop"), &data.MarginStop));
Add(new cMenuEditIntItem( tr("Setup.Recording$Primary limit"), &data.PrimaryLimit, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default priority"), &data.DefaultPriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default lifetime"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Use episode name"), &data.UseSubtitle));
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), FileNameChars));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Record Dolby Digital"), &data.RecordDolbyDigital));
Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles));
Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at start (min)"), &data.MarginStart));
Add(new cMenuEditIntItem( tr("Setup.Recording$Margin at stop (min)"), &data.MarginStop));
Add(new cMenuEditIntItem( tr("Setup.Recording$Primary limit"), &data.PrimaryLimit, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default priority"), &data.DefaultPriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("Setup.Recording$Default lifetime (d)"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Use episode name"), &data.UseSubtitle));
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), FileNameChars));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Record Dolby Digital"), &data.RecordDolbyDigital));
Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE));
Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles));
}
// --- cMenuSetupReplay ------------------------------------------------------
@ -2132,9 +2134,9 @@ void cMenuSetupMisc::Set(void)
{
Clear();
SetupTitle("Miscellaneous");
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. event timeout"), &data.MinEventTimeout));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity"), &data.MinUserInactivity));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout"), &data.SVDRPTimeout));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. event timeout (min)"), &data.MinEventTimeout));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$Min. user inactivity (min)"), &data.MinUserInactivity));
Add(new cMenuEditIntItem( tr("Setup.Miscellaneous$SVDRP timeout (min)"), &data.SVDRPTimeout));
}
// --- cMenuSetup ------------------------------------------------------------
@ -2231,6 +2233,11 @@ eOSState cMenuCommands::Execute(void)
{
cCommand *command = Commands.Get(Current());
if (command) {
char *buffer = NULL;
asprintf(&buffer, "%s...", command->Title());
Interface->Status(buffer);
Interface->Flush();
delete buffer;
const char *Result = command->Execute();
if (Result)
return AddSubMenu(new cMenuText(command->Title(), Result, fontFix));
@ -2286,7 +2293,7 @@ void cMenuMain::Set(void)
int Minutes = int(double(FreeMB) / MB_PER_MINUTE);
int Hours = Minutes / 60;
Minutes %= 60;
snprintf(buffer, sizeof(buffer), "%s - Disk %d%% - %2d:%02d %s", tr("VDR"), Percent, Hours, Minutes, tr("free"));
snprintf(buffer, sizeof(buffer), "%s - %s %d%% - %2d:%02d %s", tr("VDR"), tr("Disk"), Percent, Hours, Minutes, tr("free"));
SetTitle(buffer);
// Basic menu items:
@ -2310,6 +2317,7 @@ void cMenuMain::Set(void)
char *buffer = NULL;
asprintf(&buffer, "%s%s", STOP_RECORDING, ON_PRIMARY_INTERFACE);
Add(new cOsdItem(buffer, osStopRecord));
delete buffer;
}
const char *s = NULL;
@ -3100,64 +3108,47 @@ bool cReplayControl::ShowProgress(bool Initial)
void cReplayControl::TimeSearchDisplay(void)
{
char buf[64];
int len;
strcpy(buf, tr("Jump: "));
len = strlen(buf);
switch (timeSearchPos) {
case 1: sprintf(buf + len, "%01d-:--", timeSearchHH / 10); break;
case 2: sprintf(buf + len, "%02d:--", timeSearchHH); break;
case 3: sprintf(buf + len, "%02d:%01d-", timeSearchHH, timeSearchMM / 10); break;
case 4: sprintf(buf + len, "%02d:%02d", timeSearchHH, timeSearchMM); break;
default: sprintf(buf + len, "--:--"); break;
}
int len = strlen(buf);
char h10 = '0' + (timeSearchTime >> 24);
char h1 = '0' + ((timeSearchTime & 0x00FF0000) >> 16);
char m10 = '0' + ((timeSearchTime & 0x0000FF00) >> 8);
char m1 = '0' + (timeSearchTime & 0x000000FF);
char ch10 = timeSearchPos > 3 ? h10 : '-';
char ch1 = timeSearchPos > 2 ? h1 : '-';
char cm10 = timeSearchPos > 1 ? m10 : '-';
char cm1 = timeSearchPos > 0 ? m1 : '-';
sprintf(buf + len, "%c%c:%c%c", ch10, ch1, cm10, cm1);
DisplayAtBottom(buf);
}
void cReplayControl::TimeSearchProcess(eKeys Key)
{
int Seconds = timeSearchHH * 3600 + timeSearchMM * 60;
#define STAY_SECONDS_OFF_END 10
int Seconds = (timeSearchTime >> 24) * 36000 + ((timeSearchTime & 0x00FF0000) >> 16) * 3600 + ((timeSearchTime & 0x0000FF00) >> 8) * 600 + (timeSearchTime & 0x000000FF) * 60;
int Current = (lastCurrent / FRAMESPERSEC);
int Total = (lastTotal / FRAMESPERSEC);
switch (Key) {
case k0 ... k9:
{
int n = Key - k0;
int s = (lastTotal / FRAMESPERSEC);
int m = s / 60 % 60;
int h = s / 3600;
switch (timeSearchPos) {
case 0: if (n * 10 <= h) {
timeSearchHH = n * 10;
timeSearchPos++;
}
break;
case 1: if (timeSearchHH + n <= h) {
timeSearchHH += n;
timeSearchPos++;
}
break;
case 2: if (n <= 5 && timeSearchHH * 60 + n * 10 <= h * 60 + m) {
timeSearchMM += n * 10;
timeSearchPos++;
}
break;
case 3: if (timeSearchHH * 60 + timeSearchMM + n <= h * 60 + m) {
timeSearchMM += n;
timeSearchPos++;
}
break;
}
TimeSearchDisplay();
}
if (timeSearchPos < 4) {
timeSearchTime <<= 8;
timeSearchTime |= Key - k0;
timeSearchPos++;
TimeSearchDisplay();
}
break;
case kLeft:
case kRight:
dvbApi->SkipSeconds(Seconds * (Key == kRight ? 1 : -1));
case kRight: {
int dir = (Key == kRight ? 1 : -1);
if (dir > 0)
Seconds = min(Total - Current - STAY_SECONDS_OFF_END, Seconds);
dvbApi->SkipSeconds(Seconds * dir);
timeSearchActive = false;
}
break;
case kUp:
case kDown:
Seconds = min(Total - STAY_SECONDS_OFF_END, Seconds);
dvbApi->Goto(Seconds * FRAMESPERSEC, Key == kDown);
timeSearchActive = false;
break;
@ -3177,7 +3168,7 @@ void cReplayControl::TimeSearchProcess(eKeys Key)
void cReplayControl::TimeSearch(void)
{
timeSearchHH = timeSearchMM = timeSearchPos = 0;
timeSearchTime = timeSearchPos = 0;
timeSearchHide = false;
if (modeOnly)
Hide();
@ -3288,7 +3279,9 @@ eOSState cReplayControl::ProcessKey(eKeys Key)
ShowMode();
timeoutShow = 0;
}
else if (!modeOnly)
else if (modeOnly)
ShowMode();
else
shown = ShowProgress(!shown) || shown;
}
bool DisplayedFrames = displayFrames;

4
menu.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 1.40 2002/03/16 09:51:10 kls Exp $
* $Id: menu.h 1.41 2002/03/31 13:53:23 kls Exp $
*/
#ifndef _MENU_H
@ -116,7 +116,7 @@ private:
int lastCurrent, lastTotal;
time_t timeoutShow;
bool timeSearchActive, timeSearchHide;
int timeSearchHH, timeSearchMM, timeSearchPos;
int timeSearchTime, timeSearchPos;
void TimeSearchDisplay(void);
void TimeSearchProcess(eKeys Key);
void TimeSearch(void);

56
mpatrol.diff Normal file
View File

@ -0,0 +1,56 @@
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux VDR
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.20 -> 1.21
# config.c 1.4 -> 1.5
# tools.c 1.2 -> 1.3
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/01 aschultz@warp10.net 1.21
# fix memory management due to MPatrol
# --------------------------------------------
#
diff -Nru a/config.c b/config.c
--- a/config.c Mon Apr 1 14:37:48 2002
+++ b/config.c Mon Apr 1 14:37:48 2002
@@ -265,7 +265,7 @@
sscanf(apidbuf, "%d ,%d ", &apid1, &apid2);
if (p)
sscanf(p, "%d ,%d ", &dpid1, &dpid2);
- delete apidbuf;
+ free(apidbuf);
}
else
return false;
@@ -277,7 +277,7 @@
tpid = 0;
}
strn0cpy(name, buffer, MaxChannelName);
- delete buffer;
+ free(buffer);
}
else
return false;
diff -Nru a/tools.c b/tools.c
--- a/tools.c Mon Apr 1 14:37:48 2002
+++ b/tools.c Mon Apr 1 14:37:48 2002
@@ -71,7 +71,7 @@
esyslog(LOG_ERR, "ERROR: out of memory");
}
else {
- delete dest;
+ free(dest);
dest = NULL;
}
return dest;
@@ -230,7 +230,7 @@
const char *AddDirectory(const char *DirName, const char *FileName)
{
static char *buf = NULL;
- delete buf;
+ free(buf);
asprintf(&buf, "%s/%s", DirName && *DirName ? DirName : ".", FileName);
return buf;
}

24
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osd.c 1.21 2002/03/10 16:18:06 kls Exp $
* $Id: osd.c 1.23 2002/03/29 16:34:03 kls Exp $
*/
#include "osd.h"
@ -76,6 +76,7 @@ eOSState cOsdItem::ProcessKey(eKeys Key)
cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
{
digit = 0;
hasHotkeys = false;
visible = false;
title = NULL;
@ -105,12 +106,15 @@ cOsdMenu::~cOsdMenu()
const char *cOsdMenu::hk(const char *s)
{
static char buffer[32];
if (digit < 9) {
snprintf(buffer, sizeof(buffer), " %d %s", ++digit, s);
return buffer;
if (s && hasHotkeys) {
if (digit == 0 && '1' <= *s && *s <= '9' && *(s + 1) == ' ')
digit = 10; // prevents automatic hotkeys - input already has them
if (digit < 9) {
snprintf(buffer, sizeof(buffer), " %d %s", ++digit, s);
s = buffer;
}
}
else
return s;
return s;
}
void cOsdMenu::SetHasHotkeys(void)
@ -288,6 +292,10 @@ void cOsdMenu::PageUp(void)
first -= MAXOSDITEMS;
if (first < 0)
first = current = 0;
if (SpecialItem(current)) {
current -= (current > 0) ? 1 : -1;
first = min(first, current - 1);
}
Display();
DisplayCurrent(true);
}
@ -302,6 +310,10 @@ void cOsdMenu::PageDown(void)
current = Count() - 1;
first = Count() - MAXOSDITEMS;
}
if (SpecialItem(current)) {
current += (current < Count() - 1) ? 1 : -1;
first = max(first, current - MAXOSDITEMS);
}
Display();
DisplayCurrent(true);
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 1.57 2002/03/16 12:17:44 kls Exp $
* $Id: recording.c 1.60 2002/04/01 10:51:23 kls Exp $
*/
#include "recording.h"
@ -172,7 +172,7 @@ bool cResumeFile::Save(int Index)
if (fileName) {
int f = open(fileName, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (f >= 0) {
if (safe_write(f, &Index, sizeof(Index)) != sizeof(Index))
if (safe_write(f, &Index, sizeof(Index)) < 0)
LOG_ERROR_STR(fileName);
close(f);
return true;
@ -324,7 +324,7 @@ cRecording::cRecording(cTimer *Timer, const char *Title, const char *Subtitle, c
if (isempty(Summary))
Summary = "";
if (*Subtitle || *Summary)
asprintf(&summary, "%s%s%s", Subtitle, (*Subtitle && *Summary) ? "\n\n" : "", Summary);
asprintf(&summary, "%s\n\n%s%s%s", Title, Subtitle, (*Subtitle && *Summary) ? "\n\n" : "", Summary);
}
}
@ -343,7 +343,7 @@ cRecording::cRecording(const char *FileName)
time_t now = time(NULL);
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
t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
if (7 == sscanf(p + 1, DATAFORMAT, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &priority, &lifetime)) {
t.tm_year -= 1900;
t.tm_mon--;

12
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
* $Id: svdrp.c 1.34 2002/03/08 17:17:05 kls Exp $
* $Id: svdrp.c 1.35 2002/03/23 16:17:39 kls Exp $
*/
#include "svdrp.h"
@ -340,16 +340,12 @@ bool cSVDRP::Send(const char *s, int length)
{
if (length < 0)
length = strlen(s);
int wbytes = safe_write(file, s, length);
if (wbytes == length)
return true;
if (wbytes < 0) {
if (safe_write(file, s, length) < 0) {
LOG_ERROR;
file.Close();
return false;
}
else //XXX while...???
esyslog(LOG_ERR, "Wrote %d bytes to client while expecting %d\n", wbytes, length);
return false;
return true;
}
void cSVDRP::Reply(int Code, const char *fmt, ...)

55
tools.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: tools.c 1.59 2002/02/17 12:57:23 kls Exp $
* $Id: tools.c 1.62 2002/03/31 20:51:06 kls Exp $
*/
#include "tools.h"
@ -13,6 +13,7 @@
#include <errno.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/vfs.h>
#include <time.h>
#include <unistd.h>
#include "i18n.h"
@ -33,14 +34,22 @@ ssize_t safe_read(int filedes, void *buffer, size_t size)
ssize_t safe_write(int filedes, const void *buffer, size_t size)
{
for (;;) {
ssize_t p = write(filedes, buffer, size);
if (p < 0 && errno == EINTR) {
dsyslog(LOG_INFO, "EINTR while writing to file handle %d - retrying", filedes);
continue;
}
return p;
}
ssize_t p = 0;
ssize_t written = size;
const unsigned char *ptr = (const unsigned char *)buffer;
while (size > 0) {
p = write(filedes, ptr, size);
if (p < 0) {
if (errno == EINTR) {
dsyslog(LOG_INFO, "EINTR while writing to file handle %d - retrying", filedes);
continue;
}
break;
}
ptr += p;
size -= p;
}
return p < 0 ? p : written;
}
void writechar(int filedes, char c)
@ -235,34 +244,20 @@ const char *AddDirectory(const char *DirName, const char *FileName)
return buf;
}
#define DFCMD "df -m -P '%s'"
int FreeDiskSpaceMB(const char *Directory, int *UsedMB)
{
//TODO Find a simpler way to determine the amount of free disk space!
if (UsedMB)
*UsedMB = 0;
int Free = 0;
char *cmd = NULL;
asprintf(&cmd, DFCMD, Directory);
FILE *p = popen(cmd, "r");
if (p) {
char *s;
while ((s = readline(p)) != NULL) {
if (strchr(s, '/')) {
int used, available;
sscanf(s, "%*s %*d %d %d", &used, &available);
if (UsedMB)
*UsedMB = used;
Free = available;
break;
}
}
pclose(p);
struct statfs statFs;
if (statfs(Directory, &statFs) == 0) {
int blocksPerMeg = 1024 * 1024 / statFs.f_bsize;
if (UsedMB)
*UsedMB = (statFs.f_blocks - statFs.f_bfree) / blocksPerMeg;
Free = statFs.f_bavail / blocksPerMeg;
}
else
esyslog(LOG_ERR, "ERROR: can't open pipe for cmd '%s'", cmd);
delete cmd;
LOG_ERROR_STR(Directory);
return Free;
}

164
vdr.1 Normal file
View File

@ -0,0 +1,164 @@
'\" t
.\" ** The above line should force tbl to be a preprocessor **
.\" Man page for vdr
.\"
.\" Copyright (C) 2002 Klaus Schmidinger
.\"
.\" You may distribute under the terms of the GNU General Public
.\" License as specified in the file COPYING that comes with the
.\" vdr distribution.
.\"
.\" $Id: vdr.1 1.2 2002/03/29 10:10:04 kls Exp $
.\"
.TH vdr 1 "29 Mar 2002" "1.0.0" "Video Disk Recorder"
.SH NAME
vdr - the Video Disk Recorder
.SH SYNOPSIS
.B vdr
[options]
.SH DESCRIPTION
.B vdr
implements a complete digital Set-Top-Box and Video Recorder.
It can work with signals received from satellites (DVB-S) as
well as cable (DVB-C) and terrestrial (DVB-T) signals.
At least one DVB card is required to run \fBvdr\fR, but in order
to watch one broadcast while recording another, or to start watching
a recorded programme before the live broadcast has ended (\fBtime shifting\fR),
two DVB cards are necessary. By default \fBvdr\fR can support up to four
DVB cards. The primary DVB card (the one your tv set is connected to) has
to be a "full featured" card, which means it must contain an MPEG decoder
and provide audio and video signal outputs.
\fBvdr\fR uses the On Screen Display of the DVB card to display its menus.
It can be controlled by the PC keyboard, a home built "Remote Control Unit"
(RCU) or the "Linux Infrared Remote Control" (LIRC).
Remote access is possible via the "Simple Video Disk Recorder Protocol" (SVDRP),
which can be accessed on port 2001, for instance by \fBtelnet\fR.
.SH OPTIONS
.TP
.BI -a\ cmd ,\ --audio= cmd
Send Dolby Digital audio to stdin of command \fIcmd\fR.
.TP
.BI -c\ dir ,\ --config= dir
Read config files from directory \fIdir\fR
(default is to read them from the video directory).
.TP
.B -d, --daemon
Run in daemon mode.
.TP
.BI -D\ num ,\ --device= num
Use only the given DVB device (\fInum\fR = 0, 1, 2...).
There may be several \fB-D\fR options (by default all DVB devices will be used).
.TP
.BI -E\ file ,\ --epgfile= file
Write the EPG data into the given \fIfile\fR
(default is \fI/video/epg.data\fR).
Use \fB-E-\fR to disable this.
If \fIfile\fR is a directory, the file \fIepg.data\fR
will be created in that directory.
.TP
.B -h, --help
Print a help message and exit.
.TP
.BI -l\ level ,\ --log= level
Set logging to \fIlevel\fR.
\fB0\fR\ =\ no logging, \fB1\fR\ =\ errors only,
\fB2\fR\ =\ errors and info, \fB3\fR\ =\ errors, info and debug.
The default logging level is \fB3\fR.
.TP
.B -m, --mute
Mute audio of the primary DVB device at startup.
.TP
.BI -p\ port ,\ --port= port
Use \fIport\fR for SVDRP. A value of \fB0\fR turns off SVDRP.
The default SVDRP port is \fB2001\fR.
You need to edit the file \fIsvdrphosts.conf\fR in order to enable
access to the SVDRP port.
.TP
.BI -r\ cmd ,\ --record= cmd
Call \fIcmd\fR before and after a recording.
.TP
.BI -s\ cmd ,\ --shutdown= cmd
Call \fIcmd\fR to shutdown the computer.
.TP
.BI -t\ tty ,\ --terminal= tty
Set the controlling terminal.
.TP
.BI -v\ dir ,\ --video= dir
Use \fIdir\fR as video directory.
The default is \fI/video\fR.
.TP
.B -V, --version
Print version information and exit.
.TP
.BI -w\ sec ,\ --watchdog= sec
Activate the watchdog timer with a timeout of \fIsec\fR seconds.
A value of \fB0\fR (default) disables the watchdog.
.SH EXIT STATUS
.TP
.B 0
Successful program execution.
.TP
.B 1
An error has been detected which requires the DVB driver and \fBvdr\fR
to be re-loaded.
.SH FILES
.TP
.I channels.conf
Channel configuration.
.TP
.I ca.conf
Conditional access configuration.
.TP
.I timers.conf
Timer configuration.
.TP
.I setup.conf
User definable setup.
.TP
.I commands.conf
User definable commands (executed from the \fBCommands\fR menu).
.TP
.I svdrphosts.conf
SVDRP host configuration, defining which hosts or networks are given
access to the SVDRP port.
.TP
.I marks.vdr
Contains the editing marks defined for a recording.
.TP
.I summary.vdr
Contains a description of the recording.
.TP
.I resume.vdr
Contains the index into the recording where the last replay session left off.
.TP
.I index.vdr
Contains the file number, offset and type of each frame of the recording.
.TP
.I keys.conf
Contains the key assignments for the remote control.
.TP
.I keys-pc.conf
Contains the key assignments for the PC keyboard (used if the program
was compiled with DEBUG_OSD=1).
.TP
.IR 001.vdr\ ...\ 255.vdr
The actual data files of a recording.
.TP
.I epg.data
Contains all current EPG data. Can be used for external processing and will
also be read at program startup to have the full EPG data available immediately.
.SH SEE ALSO
.BR vdr (5)
.SH AUTHOR
Written by Klaus Schmidinger, with contributions from many others.
See the file \fICONTRIBUTORS\fR in the \fBvdr\fR source distribution.
.SH REPORTING BUGS
Report bugs to <vdr-bugs@cadsoft.de>.
.SH COPYRIGHT
Copyright \(co 2002 Klaus Schmidinger.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

382
vdr.5 Normal file
View File

@ -0,0 +1,382 @@
'\" t
.\" ** The above line should force tbl to be a preprocessor **
.\" Man page for vdr file formats
.\"
.\" Copyright (C) 2002 Klaus Schmidinger
.\"
.\" You may distribute under the terms of the GNU General Public
.\" License as specified in the file COPYING that comes with the
.\" vdr distribution.
.\"
.\" $Id: vdr.5 1.3 2002/04/01 12:32:59 kls Exp $
.\"
.TH vdr 5 "29 Mar 2002" "1.0.0" "Video Disk Recorder Files"
.SH NAME
vdr file formats - the Video Disk Recorder Files
.SH DESCRIPTION
This page describes the formats of the various files \fBvdr\fR uses to
store configuration data and recordings.
.SH SYNTAX
.SS CHANNELS
The file \fIchannels.conf\fR contains the channel configuration.
Each line defines either a \fBgroup delimiter\fR or a \fBchannel\fR.
A \fBgroup delimiter\fR is a line starting with a ':' as the very first
character, followed by arbitrary text. Example:
\fB:First group\fR
A \fBchannel definition\fR is a line with channel data, where the fields
are separated by ':' characters. Example:
\fBRTL:12188:h:1:27500:163:104:105:0:12003\fR
The line number of a channel definition (not counting group separators!)
defines the channel's number in OSD menus and the \fItimers.conf\fR file.
The fields in a channel definition have the following meaning (from left
to right):
.TP
.B Name
The channel's name (if the name originally contains a ':' character
it has to be replaced by '|').
.TP
.B Frequency
The transponder frequency in MHz for DVB-S and DVB-C, kHz for DVB-T (as an integer).
.TP
.B Polarization
The polarization of the satellite signal. 'h' or 'H' for horizontal, 'v' or 'V'
for vertical (DVB-S only).
.TP
.B
DiSEqC
The DiSEqC code to use for this channel (integer, DVB-S only).
.TP
.B
Srate
The symbol rate of this channel (DVB-S and DVB-C only).
.TP
.B VPID
The video PID (set to '0' for radio channels, '1' for encrypted radio channels).
.TP
.B APID
The audio PID (either one number, or two, separated by a comma).
If this channel also carries Dolby Digital sound, the Dolby PIDs follow
the audio PIDs, separated by a semicolon, as in
.B ...:101,102;103,104:...
.TP
.B TPID
The teletext PID.
.TP
.B Conditional access
An integer defining how this channel can be accessed:
.TS
tab (@);
l l.
\fB0\fR@Free To Air
\fB1...4\fR@explicitly requires the DVB card with the given number
\fB>=100\fR@requires a specific decryption method defined in \fIca.conf\fR
.TE
.TP
.B PNR
The program number (aka service ID) of this channel.
.SS TIMERS
The file \fItimers.conf\fR contains the timer setup.
Each line contains one timer definition, with individual fields
separated by ':' characters. Example:
\fB1:10:-T-----:2058:2150:50:5:Quarks & Co:\fR
The fields in a timer definition have the following meaning (from left
to right):
.TP
.B Status
Defines whether this timer is \fBinactive\fR (0) or \fBactive\fR (1).
The value 3 is used for instant recordings.
Values other than these can be used by external programs to mark active timers
and recognize if the user has modified them. When a user modifes an active
timer the \fBstatus\fR field will be explicitly set to '1' (or '0', respectively,
if the user deactivates the timer).
Note: in order to allow future extensibility, external programs using the
\fBstatus\fR parameter should only use the upper 16 bit of this 32 bit parameter
and leave the lower 16 bit untouched.
.TP
.B Channel
The number of the channel to record.
.TP
.B Day
The day when this timer shall record.
If this is a `single-shot' timer, this is the day of month on which this
timer shall record. This must be in the range \fB1...31\fR.
In case of a `repeating' timer this is a string consisting of exactly seven
characters, where each character position corresponds to one day of the week
(with Monday being the first day). The character '-' at a certain position
means that the timer shall not record on that day. Any other character will
cause the timer to record on that day. Example:
.B MTWTF--
will define a timer that records on Monday thru Friday and does not record
on weekends. The same result could be achieved with \fBABCDE--\fR (this is
used to allow setting the days with language specific characters).
The day definition of a `repeating' timer may be followed by the date when that
timer shall hit for the first time. The format for this is \fB@YYYY-MM-DD\fR,
so a complete definition could look like this:
\fBMTWTF--@2002-02-18\fR
which would implement a timer that records Moday thru Friday, and will hit
for the first time on or after February 18, 2002.
This \fBfirst day\fR feature can be used to disable a repeating timer for a couple
of days, or for instance to define a new Mon...Fri timer on wednesday, which
actually starts "monday next week". The \fBfirst day\fR date given need not be
that of a day when the timer would actually hit.
.TP
.B Start
A four digit integer defining when this timer shall \fBstart\fR recording.
The format is \fBhhmm\fR, so \fB1430\fR would mean "half past two" in the
afternoon.
.TP
.B Stop
A four digit integer defining when this timer shall \fBstop\fR recording.
The format is the same as for the \fBstart\fR time.
.TP
.B Priority
An integer in the range \fB0...99\fR, defining the \fBpriority\fR
of this timer and of recordings created by this timer.
\fB0\fR represents the lowest value, \fB99\fR the highest.
The priority is used to decide which timer shall be
started in case there are two or more timers with the exact same
\fBstart\fR time. The first timer in the list with the highest priority
will be used.
This value is also stored with the recording and is
later used to decide which recording to remove from disk in order
to free space for a new recording. If the disk runs full and a new
recording needs more space, an existing recording with the lowest
priority (and which has exceeded its guaranteed \fBlifetime\fR) will be
removed.
If all available DVB cards are currently occupied, a
timer with a higher priority will interrupt the timer with the
lowest priority in order to start recording.
.TP
.B Lifetime
The \fBguaranteed lifetime\fR (in days) of a recording created by this timer.
\fB0\fR means that this recording may be automatically deleted at any time
by a new recording with higher priority. \fB99\fR means that this recording
will never be automatically deleted. Any number in the range \fB1...98\fR
means that this recording may not be automatically deleted in favour of a
new recording, until the given number of days since the \fBstart\fR time of
the recording has passed by.
.TP
.B File
The \fBfile name\fR this timer will give to a recording.
If the name contains any ':' characters, these have to be replaced by '|'.
If the name shall contain subdirectories, these have to be delimited by '~'
(since the '/' character may be part of a regular programme name).
The special keywords \fBTITLE\fR and \fBEPISODE\fR, if present, will be replaced
by the title and episode information from the EPG data at the time of
recording (if that data is available). If at the time of recording either
of these cannot be determined, \fBTITLE\fR will default to the channel name, and
\fBEPISODE\fR will default to a blank.
.TP
.B Summary
Arbitrary text that describes the recording made by this timer.
Any newline characters in the summary have to be replaced by '|', and
the summary may contain ':' characters. If this field is not empty, its
contents will be written into the \fIsummary.vdr\fR file of the recording.
.SS CONDITIONAL ACCESS
The file \fIca.conf\fR defines the numbers to be used in the \fBConditional access\fR
field of channels in \fIchannels.conf\fR and assigns descriptive texts to them.
Example:
\fB101 Premiere World\fR
Anything after (and including) a '#' character is comment.
Value lines consist of an integer number, followed by a text describing
this decryption method (typically the name of the pay tv service using this
decryption method).
The special value \fB0\fR means \fBFree To Air\fR, which can be used for
channels that don't require additional decryption hardware.
The values \fB1...4\fR can be used for channels that for some reason explicitly
need a given DVB card (for backward compatibility).
.SS KEYS
The file \fIkeys.conf\fR contains the key assignments for the remote control
unit (RCU). If \fBvdr\fR has been built with REMOTE=KBD, the file \fIkeys-pc.conf\fR
will be used instead. If you are using \fBvdr\fR together with \fBLIRC\fR, no
such file will be used. In that case you need to consult the \fBLIRC\fR
documentation to see how to set up the remote control key assignments there.
.SS COMMANDS
The file \fIcommands.conf\fR contains the definitions of commands that can
be executed from the \fBvdr\fR main menu's "Commands" option.
Each line contains one command definition in the following format:
\fBtitle : command\fR
where \fBtitle\fR is the string that will be displayed in the "Commands" menu,
and \fBcommand\fR is the actual command string that will be executed when this
option is selected. The delimiting ':' may be surrounded by any number of
white space characters.
By default the menu entries in the "Commands" menu will be numbered '1'...'9'
to make them selectable by pressing the corresponding number key. If you want
to use your own numbering scheme (maybe to skip certain numbers), just precede
the \fBtitle\fRs with the numbers of your choice. \fBvdr\fR will suppress its
automatic numbering if the first entry in \fIcommands.conf\fR starts with a
digit in the range '1'...'9', followed by a blank.
In order to avoid error messages to the console, every command should have
\fIstderr\fR redirected to \fIstdout\fR. Everything the command prints to
\fIstdout\fR will be displayed in a result window, with \fBtitle\fR as its title.
Examples:
Check for new mail: /usr/local/bin/checkmail 2>&1
.br
CPU status : /usr/local/bin/cpustatus 2>&1
.br
Disk space : df -h | grep '/video' | awk '{ print 100 - $5 "% free"; }'
.br
Calendar : date;echo;cal
Note that the commands 'checkmail' and 'cpustatus' are only \fBexamples\fR!
Don't send emails to the author asking where to find these ;-)
.SS SVDRP HOSTS
The file \fIsvdrphosts.conf\fR contains the IP numbers of all hosts that are
allowed to access the SVDRP port.
Each line contains one IP number in the format
\fBIP-Address[/Netmask]\fR
where \fBIP-Address\fR is the address of a host or a network in the usual dot
separated notation (as in 192.168.100.1). If the optional \fBNetmask\fR is given
only the given number of bits of \fBIP-Address\fR are taken into account. This
allows you to grant SVDRP access to all hosts of an entire network. \fBNetmask\fR
can be any integer from 1 to 32. The special value of 0 is only accepted if
the \fBIP-Address\fR is 0.0.0.0, because this will give access to any host
(\fBUSE THIS WITH CARE!\fR).
Everything following (and including) a '#' character is considered to be comment.
Examples:
127.0.0.1 # always accept localhost
.br
192.168.100.0/24 # any host on the local net
.br
204.152.189.113 # a specific host
.br
0.0.0.0/0 # any host on any net (\fBUSE WITH CARE!\fR)
.SS SETUP
The file \fIsetup.conf\fR contains the basic configuration options for \fBvdr\fR.
Each line contains one option in the format "Name = Value".
See the MANUAL file for a description of the available options.
.SS AUDIO/VIDEO DATA
The files \fI001.vdr\fR...\fI255.vdr\fR are the actual recorded MPEG data
files. In order to keep the size of an individual file below a given limit,
a recording is split into several files. The contents of these files is
\fBPacketized Elementary Stream\fR (PES) and contains ES packets with ids
0xE0 for video, 0xC0 for audio 1 and 0xC1 for audio 2 (if available).
Dolby Digital data is stored in packets with ids 0xBD.
.SS INDEX
The file \fIindex.vdr\fR (if present in a recording directory) contains
the (binary) index data into each of the the recording files
\fI001.vdr\fR...\fI255.vdr\fR. It is used during replay to determine
the current position within the recording, and to implement skipping
and fast forward/back functions.
See the definition of the \fBcIndexFile\fR class for details about the
actual contents of this file.
.SS SUMMARY
The file \fIsummary.vdr\fR (if present in a recording directory) contains
a description of the recording, derived from the EPG data at recording time
(if such data was available) or the \fBSummary\fR field of the corresponding
timer. This is a plain ASCII file and can contain arbitrary text.
.SS RESUME
The file \fIresume.vdr\fR (if present in a recording directory) contains
the position within the recording where the last replay session left off.
The data is a four byte (binary) integer value and defines an offset into
the file \fIindex.vdr\fR.
.SS MARKS
The file \fImarks.vdr\fR (if present in a recording directory) contains
the editing marks defined for this recording.
Each line contains the definition of one mark in the following format:
\fBhh:mm:ss.ff comment\fR
where \fBhh:mm:ss.ff\fR is a frame position within the recording, given as
"hours, minutes, seconds and (optional) frame number".
\fBcomment\fR can be any string and may be used to describe this mark.
If present, \fBcomment\fR must be separated from the frame position by at
least one blank.
The lines in this file need not necessarily appear in the correct temporal
sequence, they will be automatically sorted by time index.
\fBCURRENT RESTRICTIONS:\fR
-\ the comment is currently not used by VDR
.br
-\ marks must have a frame number, and that frame MUST be an I-frame (this
means that only marks generated by VDR itself can be used, since they
will always be guaranteed to mark I-frames).
.SS EPG DATA
The file \fIepg.data\fR contains the EPG data in an easily parsable format.
The first character of each line defines what kind of data this line contains.
The following tag characters are defined:
.TS
tab (@);
l l.
\fBC\fR@<service id> <channel name>
\fBE\fR@<event id> <start time> <duration> <table id>
\fBT\fR@<title>
\fBS\fR@<subtitle>
\fBD\fR@<description>
\fBe\fR@
\fBc\fR@
.TE
Lowercase characters mark the end of a sequence that was started by the
corresponding uppercase character. The outer frame consists of a sequence
of one or more \fBC\fR...\fBc\fR (Channel) entries. Inside these any number of
\fBE\fR...\fBe\fR (Event) entries are allowed.
The \fBT\fR, \fBS\fR and \fBD\fR entries are optional (although every event
should at least have a \fBT\fR entry).
.TS
tab (@);
l l.
<service id> @is the "program number" as defined in 'channels.conf'
<channel name> @is the "name" as in 'channels.conf' (for information only)
<start time> @is the time (as a time_t integer) in UTC when this event starts
<duration> @is the time (in seconds) that this event will take
<table id> @is a hex number that indicates the table this event is contained\
in (if this is left empty or 0 this event will not be overwritten\
or modified by data that comes from the DVB stream)
<title> @is the title of the event
<subtitle> @is the subtitle (typically the name of the episode etc.)
<description> @is the description of the event
.TE
This file will be read at program startup in order to restore the results of
previous EPG scans.
.SH SEE ALSO
.BR vdr (1)
.SH AUTHOR
Written by Klaus Schmidinger.
.SH REPORTING BUGS
Report bugs to <vdr-bugs@cadsoft.de>.
.SH COPYRIGHT
Copyright \(co 2002 Klaus Schmidinger.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

11
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
* $Id: vdr.c 1.101 2002/03/09 17:10:16 kls Exp $
* $Id: vdr.c 1.102 2002/03/29 10:09:20 kls Exp $
*/
#include <getopt.h>
@ -101,6 +101,7 @@ int main(int argc, char *argv[])
{ "record", required_argument, NULL, 'r' },
{ "shutdown", required_argument, NULL, 's' },
{ "terminal", required_argument, NULL, 't' },
{ "version", no_argument, NULL, 'V' },
{ "video", required_argument, NULL, 'v' },
{ "watchdog", required_argument, NULL, 'w' },
{ NULL }
@ -108,7 +109,7 @@ int main(int argc, char *argv[])
int c;
int option_index = 0;
while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:mp:r:s:t:v:w:", long_options, &option_index)) != -1) {
while ((c = getopt_long(argc, argv, "a:c:dD:E:hl:mp:r:s:t:v:Vw:", long_options, &option_index)) != -1) {
switch (c) {
case 'a': cDvbApi::SetAudioCommand(optarg);
break;
@ -139,7 +140,7 @@ int main(int argc, char *argv[])
" %s); use '-E-' to disable this\n"
" if FILE is a directory, the default EPG file will be\n"
" created in that directory\n"
" -h, --help display this help and exit\n"
" -h, --help print this help and exit\n"
" -l LEVEL, --log=LEVEL set log level (default: 3)\n"
" 0 = no logging, 1 = errors only,\n"
" 2 = errors and info, 3 = errors, info and debug\n"
@ -149,6 +150,7 @@ int main(int argc, char *argv[])
" -r CMD, --record=CMD call CMD before and after a recording\n"
" -s CMD, --shutdown=CMD call CMD to shutdown the computer\n"
" -t TTY, --terminal=TTY controlling tty\n"
" -V, --version print version information and exit\n"
" -v DIR, --video=DIR use DIR as video directory (default: %s)\n"
" -w SEC, --watchdog=SEC activate the watchdog timer with a timeout of SEC\n"
" seconds (default: %d); '0' disables the watchdog\n"
@ -186,6 +188,9 @@ int main(int argc, char *argv[])
break;
case 't': Terminal = optarg;
break;
case 'V': printf("vdr, version %s\n", VDRVERSION);
return 0;
break;
case 'v': VideoDirectory = optarg;
while (optarg && *optarg && optarg[strlen(optarg) - 1] == '/')
optarg[strlen(optarg) - 1] = 0;