Version 1.2.0pre1

- Some corrections to the French OSD texts (thanks to Olivier Jacques).
- Fixed some missing commas in i18n.c (thanks to Dimitrios Dimitrakos for
  reporting this problem).
- Some corrections to the Finnish OSD texts (thanks to Niko Tarnanen and Rolf
  Ahrenberg).
- Completed the Italian OSD texts (thanks to Antonio Ospite).
- Fixed breaking off replay in case the user hits "Play" or "Pause" too soon after
  going into "Pause live video" mode (thanks to Karim Afifi for reporting ths one).
- Some corrections to the Catalanian OSD texts (thanks to Jordi Vilà).
- Single event timers are now deleted if the recording they are doing is
  deleted before the timer ends.
- Fixed an uninitialized variable in cDisplayChannel (thanks to Stefan Huelswitt).
- Fixed a possible access of invalid file handles in cSIProcessor::Action()
  (thanks to Stefan Huelswitt).
This commit is contained in:
Klaus Schmidinger 2003-05-30 18:00:00 +02:00
parent 8ab980e1d9
commit d072cc6da2
16 changed files with 570 additions and 233 deletions

View File

@ -173,6 +173,8 @@ Stefan Huelswitt <huels@iname.com>
video sequence, which avoids artefacts when cutting
for suggesting to add VDRVERSNUM to config.h
for fixing a memory leak in cNonBlockingFileReader
for fixing an uninitialized variable in cDisplayChannel
for fixing a possible access of invalid file handles in cSIProcessor::Action()
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than
@ -677,7 +679,7 @@ Alfred Zastrow <vdr@zastrow4u.de>
Matthias Raus <matthias-raus@web.de>
for reporting a problem with starting the editing process if no marks have been set
Marc Rovira Vall <tm05462@salleURL.edu> and Ramon Roca <ramon.roca@xcombo.com>
Marc Rovira Vall <tm05462@salleURL.edu>, Ramon Roca <ramon.roca@xcombo.com> and Jordi Vilà <jvila@tinet.org>
for translating OSD texts to the Catalanian language
Lars Bläser <LBlaeser@hofheim.de>
@ -699,3 +701,10 @@ Peter Bieringer <pb@bieringer.de>
Alexander Damhuis <ad@phonedation.de>
for reporting problems when deleting a timer that is currently recording
Antonio Ospite <ospite@studenti.unina.it>
for translating OSD texts to the Italian language
Karim Afifi <karim.afifi@free.fr>
for reporting a problem with breaking off replay in case the user presses "Play"
or "Pause" too soon after going into "Pause live video" mode

17
HISTORY
View File

@ -2208,3 +2208,20 @@ Video Disk Recorder Revision History
(thanks to Gerhard Steiner for reporting this one).
- It is now possible to directly delete a timer that is currently recording
(thanks to Alexander Damhuis for reporting this one).
2003-05-30: Version 1.2.0pre1
- Some corrections to the French OSD texts (thanks to Olivier Jacques).
- Fixed some missing commas in i18n.c (thanks to Dimitrios Dimitrakos for
reporting this problem).
- Some corrections to the Finnish OSD texts (thanks to Niko Tarnanen and Rolf
Ahrenberg).
- Completed the Italian OSD texts (thanks to Antonio Ospite).
- Fixed breaking off replay in case the user hits "Play" or "Pause" too soon after
going into "Pause live video" mode (thanks to Karim Afifi for reporting ths one).
- Some corrections to the Catalanian OSD texts (thanks to Jordi Vilà).
- Single event timers are now deleted if the recording they are doing is
deleted before the timer ends.
- Fixed an uninitialized variable in cDisplayChannel (thanks to Stefan Huelswitt).
- Fixed a possible access of invalid file handles in cSIProcessor::Action()
(thanks to Stefan Huelswitt).

View File

@ -1,6 +1,9 @@
Installation of the Video Disk Recorder
---------------------------------------
Version 1.2
-----------
Compiling and running the program:
----------------------------------
@ -15,7 +18,7 @@ If you have the DVB driver source in a different location
you will have to change the definition of DVBDIR in the
Makefile (see the file Make.config.template).
VDR requires the Linux-DVB card driver version dated 2002-11-01 or higher
VDR requires the Linux-DVB card driver version dated 2003-05-24 or higher
to work properly.
After extracting the package, change into the VDR directory

3
MANUAL
View File

@ -1,6 +1,9 @@
Video Disk Recorder User's Manual
---------------------------------
Version 1.2
-----------
* Remote Control Keys
The following remote control keys are used to control the VDR

View File

@ -6,6 +6,14 @@
<center><h1>The VDR Plugin System</h1></center>
<center><b>Version 1.2</b></center>
<p>
<center>
Copyright &copy; 2003 Klaus Schmidinger<br>
<a href="mailto:kls@cadsoft.de">kls@cadsoft.de</a><br>
<a href="http://www.cadsoft.de/vdr">www.cadsoft.de/vdr</a>
</center>
<p>
VDR provides an easy to use plugin interface that allows additional functionality
to be added to the program by implementing a dynamically loadable library file.
This interface allows programmers to develop additional functionality for VDR completely

3
README
View File

@ -14,6 +14,9 @@ this program on your computer.
The MANUAL file describes how to operate the VDR.
The CONTRIBUTORS file lists all the people who have contributed to the
development of VDR.
The author can be contacted at kls@cadsoft.de.
Yet another "set-top-box"?

274
UPDATE-1.2.0 Normal file
View File

@ -0,0 +1,274 @@
This is a summary of the changes in VDR 1.2.0 since the last stable
version 1.0.4. It only contains things that are of actual importance
to the user and doesn't mention the many fixes and improvements that
have been made "behind the scenes".
See the file HISTORY for a detailed list of all changes.
Plugins:
- Implemented a universal plugin interface. See the file PLUGINS.html
for a detailed description. The man page vdr(1) describes the new options '-L'
and '-P' used to load plugins.
See http://www.cadsoft.de/vdr/plugins.htm for a list of available plugins.
- Rearranged the remote control key handling to allow plugins to implement
additional types of remote controls (see PLUGINS.html, section "Remote Control").
The previously used files 'keys.conf' and 'keys-pc.conf' have been replaced
by the file 'remote.conf', which holds the key definitions of all remote controls.
- The new plugin 'sky' can be used to integrate a Sky Digibox into the VDR system,
using a Kfir MPEG2 encoder card (see PLUGINS/src/sky/README for details).
Remote control:
- If a PC keyboard is used as remote control, the string entry fields in the
menus now accept character input directly (however, this works only for keys that
are not otherwise defined as remote control keys). Also, plugins can switch the
cKbdRemote class into "raw mode", where all keyboard input will be made available
through the new 'kKbd' key code and none of it will be processed as normal remote
control functions.
- The LIRC remote control keys are now handled just like the keyboard and RCU keys.
This means that you can use the lircd.conf file as is for your remote control,
without the need of editing it to make the key names the same as used in VDR.
When first starting VDR it will go into the "Learning keys" mode and ask you
to press the various keys. The resulting key assignment will be stored in
the file 'remote.conf'.
- While learning the remote control keys it is now possible to press the 'Menu'
key to skip the definition of keys that are not available on your particular
RC unit.
- Implemented additional dedicated keys for "Play", "Pause", "Stop", "Record",
"FastFwd", "FastRew", "Channel+" and "Channel-". If your remote control supports
any of these keys you can delete your 'remote.conf' file and restart VDR to
go through the key learning procedure again in order to assign these new keys.
See MANUAL for more information.
- Implemented new keys to directly access the VDR main menu functions "Schedule",
"Channels", "Timers", "Recordings", "Setup" and "Commands". If your remote
control provides keys you want to assign these functions to, you can delete
your 'remote.cof' file and restart VDR to go through the key learning procedure
again in order to assign these new keys. See MANUAL for more information.
- The new configuration file 'keymacros.conf' can be used to assign macros to
the color buttons in normal viewing mode, as well as to up to 9 user defined
keys. See MANUAL and man vdr(5) for more information. The default 'keymacros.conf'
implements the functionality of the old "color button patch".
- Macros in 'keymacros.conf' can now use "@plugin" to directly access the main menu
function of a given plugin (see man vdr(5) for details).
- The keyboard is now by default always active to control VDR. The 'make' option
REMOTE=KBD is therefore obsolete. When compiling VDR with REMOTE=RCU or REMOTE=LIRC,
the keyboard can thus now be active together with the remote control. If you want
to build VDR without keyboard support you can set NO_KBD=1 in the 'make' call.
Since the keyboard codes are now different from the ones used previously (which
were mapped by the 'ncurses' library) you will need to go through the "Learning
keys" procedure again. To do so, either delete the file /video/remote.conf or
remove the KBD.* entries from it before starting this version of VDR.
- The "Left" and "Right" buttons now set the cursor to the first or last list item
even if the list consist only of a single page, like, for instance, the Main menu.
- The red ("Record") and yellow ("Pause") button in the "Main" menu are no longer
available when replaying.
Devices:
- If the primary device (as defined in setup.conf) doesn't have an MPEG decoder
(and thus can't be used as a primary device) VDR now scans all devices at
startup and uses the first one (if any) that actually has an MPEG decoder.
That way this will also work automatically if the primary device is implemented
by a plugin.
- If no device with an MPEG decoder can be found at startup, the first device
is now used as primary device (just to have some device).
- Now turning off live PIDs when replaying. This avoids short spikes from other
channels when switching between Transfer Mode channels, and also lets an ongoing
replay continue even if a recording is started on the primary device.
- Now switching to the channel used by the most recently started timer in case
the original current channel becomes unavailable due to a recording on a
different transponder. If this fails, a channel up/down switch is attempted as
a fallback solution.
- Changed the DEFAULTPRIORITY in device.c to -1, so that the primary device
will be used for FTA recordings in case the CAM is connected to a non-primary
device.
- The actual tuning is now done in a separate thread, which makes zapping through the
channels a lot faster and no longer gets stuck on channels that don't broadcast.
This also makes "Motor-DiSEqC" work. Since switching channels now no longer
explicitly waits for a channel lock in the foreground thread, the "panic level"
mechanism is no longer used.
Time Shifting:
- Changed device handling for being able to do simultaneous recording and
replay on the same device (Time Shifting). In order for this to work you need
to use a driver with a firmware version that has this feature implemented.
- It is now possible to do simultaneous recording and replay with a single DVB
card, even with encrypted channels. This requires the use of the Link Layer
firmware, version 2613 or higher; the -icam firmware is still limited to live
encrypted channels only. Finally we have time shift for encrypted channels on
single card systems!
- Implemented "pause live video". You can now press "Menu/Yellow" or "Pause" on
your remote control while watching live video to start an instant recording
of the current programme and immediately start replaying that recording.
- Implemented separate PausePriority and PauseLifetime parameters for the recordings
created when pausing live video.
Channels:
- Modified channel handling to cover all parameters necessary for DVB-C and DVB-T
(see man vdr(5) for the meaning of the additional parameters stored in the field
previously named 'polarisation').
If you have a system with different kinds of DVB cards, like DVB-T and DVB-C,
for instance, there is no more need to distinguish the channels through the
'Ca' parameter in order to assign them to the various DVB cards. This is now
taken care of by the "source" parameter. So a channel marked as "terrestrial",
for example, will only be received on DVB-T cards.
- Updated channels.conf files.
- Switching through channels with the 'Up' and 'Down' keys now skips channels
that are currently not available (for instance because all devices are
recording and these channels are on different transponders).
- The new configuration file 'sources.conf' contains the various signal sources
(satellites, cable and terrestrial) which are used in 'channels.conf' and
'diseqc.conf'.
- The 'diseqc' parameter in the channel definitions has been redefined to hold the
"source" of the given channel (which can be either a satellite, cable or terrestrial).
For compatibility with channels.conf files from older versions, numeric values in
this parameter will be tolerated, but they have no meaning. If you want to use
DiSEqC you will need to replace these old values with the proper source identifiers
defined in the new configuration file 'sources.conf'. See how this is done in the
'channels.conf' file that comes with the VDR package.
- The new configuration file 'diseqc.conf' can be used to set up the individual
diseqc configuration (see man vdr(5) for a description of the file format).
- The "Edit channel" menu has a new entry "Source:" in which the source of this
channel can be selected (either a satellite, cable or terrestrial). The set of
parameters at the end of this menu will change according to the type of source.
- The "Use DiSEqC" parameter in the "Setup/LNB" menu has been moved to the beginning
of the list and disables the rest of the parameters when set to "yes", since these
are now only meaningful if DiSEqC is not used.
- Group separators in 'channels.conf' may now be given like ':@201 My Channels',
where '@201' indicates the number to be given to the next channel. This can be
used to create 'gaps' in the channel numbering (see 'man 5 vdr'). BE CAREFUL
TO UPDATE YOUR 'timers.conf' ACCORDINGLY IF INSERTING THIS NEW FEATURE INTO YOUR
'channels.conf' FILE!
- Frequency values for cable and terrestrial channels in 'channels.conf' can
now be given either in MHz, kHz or Hz. The actual value given will be multiplied
by 1000 until it is larger than 1000000.
- First step towards a "unique channel ID". The channel ID is a human readable
string, made up from several parameters of the channel's definition in the file
'channels.conf' (see man vdr(5) for details).
In order for the "unique channel ID" to work, all channel definitions now must
be unique with respect to the combination of their Source, Frequency and SID
parameters. You may have to fix your 'channels.conf' manually if there are error
messages in the log file when loading it. BE SURE TO MAKE A BACKUP COPY OF YOUR
'channels.conf' AND 'timers.conf' FILE BEFORE SWITCHING TO THIS VERSION, AND CHECK
VERY CAREFULLY WHETHER YOUR TIMERS ARE STILL SET TO THE RIGHT CHANNELS!
When reading an existing 'timers.conf', the channels will be identified as before
by their numbers. As soon as this file is written back, the channel numbers will
be replaced by the channel IDs. After that it is possible to manually edit the
'channels.conf' file and rearrange the channels without breaking the timers.
Note that you can still define new timers manually by using the channel number.
VDR will correctly identify the 'channel' parameter in a timer definition and
use it as a channel number or a channel ID, respectively. Also, the SVDRP commands
that return timer definitions will list them with channel numbers in order to
stay compatible with existing applications.
The channel ID is also used in the 'epg.data' file to allow EPG information from
different sources to be stored, which would previously have been mixed up in case
they were using the same 'service ID'. Note that the contents of an existing
'epg.data' file from a previous version will be silently ignored, since it doesn't
contain the new channel IDs. When inserting EPG data into VDR via SVDRP you now also
need to use the channel IDs.
Currently the EPG data received from the DVB data stream only uses the 'Source'
and 'Service ID' part of the channel ID. This makes it work for channels with
the same service IDs on different sources (like satellites, cable or terrestrial).
However, it doesn't work yet if the service IDs are not unique within a specific
source. This will be fixed later.
- Added three new fields to the lines in 'channels.conf': NID, TID and RID. NID and
TID are the Network and Transport Stream IDs, respectively. RID is an additional ID
that can be used to tell apart channels that would otherwise be indistinguishable.
This is typically the case with radio channels, which may have the same NID, TID
and SID, but different "radio IDs". This new field is therefore called RID ("radio
ID"). Currently NID and TID are not yet used by VDR and should always be 0. The
RID is actually used when building the "unique channel ID", so if you have channels
in your 'channels.conf' file that cause error messages when loading, you can set
the RIDs of these channels to different values.
When reading an old 'channels.conf' these new fields will be automatically
initialized to 0 and once the file is written back to disk they will be appended
to the channel definitions.
- The "unique channel ID" now contains an optional 5th part (the RID). See man vdr(5).
- Modified LOF handling to allow for C-band reception.
- The PCR PID can now be set separately from the video PID. The syntax in the
'channels.conf' file is, for example, ...:164+17:..., where 164 is the video PID
and 17 is the PCR PID. The separator is a '+' sign, not a comma or semicolon as
with the audio PIDs, because this is not an alternate PID, but rather an
additional, necessary PID.
Recording:
- It is now possible to record several channels on the same transponder with "budget
cards". VDR automatically attaches a recording timer to a card that already
records on the appropriate transponder. How many parallel recordings can actually
be done depends on the computer's performance. Currently any number of recordings
gets attached to a card, so you should carefully plan your timers to not exceed
the limit. On a K6-II/450 it was possible to record three channels from transponder
12480 with a single WinTV NOVA-S.
- Timers that record two successive shows on the same channel may now overlap and
will use the same DVB card. During the time where both timers record the data
is simply saved to both files.
- Since several channels put very long strings into the Subtitle part of their
EPG data, that string is now limited in length when used in a recording's
file name.
- Timers are now processed even if an OSD menu is open (except for menus that
explicitly handle timers).
- Implemented a "resume ID" which allows several users to each have their own
resume.vdr files. This parameter can be set in the "Setup/Replay" menu (see
MANUAL for details).
- Extended logging info when starting/stopping timers to show the channel number,
start/stop time and the file name.
- Reduced the time to wait for EPG data when starting a recording to 3 seconds.
- Checking for duplicate recordings with the same file name and disabling the
second timer.
- It is now possible to directly delete a timer that is currently recording.
SVDRP:
- The new SVDRP command CLRE can be used to clear the entire EPG data.
- The SVDRP command PUTE now triggers an immediate write of the 'epg.data' file.
- The SVDRP command CHAN now also accepts channel IDs.
- The new SVDRP command STAT can be used to request information about the disk
usage.
- Now taking an active SVDRP connection into account when doing shutdown or
housekeeping.
Conditional Access:
- Implemented "Link Layer" based CAM support. This allows access to the CAM menu
and also to reset the CAM. Furthermore the CAM can now be in any slot of any
DVB card, and there can be more than one CAM.
- If your particular CAM doesn't work with the Link Layer interface, you can
still use the old firmware version ("-icam"), which does all the CAM handling
by itself (see DVB/driver/av7110/README-firmware).
Misc:
- Removed compiler option '-m486' to make it work on non-Intel platforms.
- Changed setting of CXX and CXXFLAGS variables in Makefile, so that an externally
defined value will be taken if present.
- New and improved internationalized OSD texts.
- The VDR version number is now displayed in the title line of the "Setup" menu.
- Changed the VFAT handling to allow users who normally use it but have forgotten
to set it when compiling a new version of VDR to at least see their recordings
made with VFAT enabled.
- Commands in the file 'commands.conf' can now have a '?' at the end of their
title, which will result in a confirmation prompt before executing the
command.
- If a command executed from the "Commands" menu doesn't return any output, the
OSD will now be closed automatically.
- The new configuration file 'reccmds.conf' can be used to define commands that
shall be executed from the "Recordings" menu; see MANUAL and 'man vdr(5)' for
details.
- The Makefile now includes the file Make.config (if present in the VDR source
directory), which allows the user to overwrite several settings with individual
values. The VDR distribution archive does not contain this file in order to not
overwrite a user defined file. There is a Make.config.template which contains the
default values of the macros the user can overwrite.
- Extended the '-l' option to allow logging to LOG_LOCALn (n=0..7) by writing, for
instance, '-l 3.7'.
- The character '|' in description texts of EPG records is now interpreted as a
newline character.
- Now using "Doxygen" to generate source documentation.
See INSTALL for information how to do this. Some function descriptions have
already been adapted to Doxygen, more will follow.
- Added VDRVERSNUM to config.h, which can be used by the preprocessor to check the
actual VDR version.

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.160 2003/05/19 15:27:37 kls Exp $
* $Id: config.h 1.162 2003/05/29 12:17:37 kls Exp $
*/
#ifndef __CONFIG_H
@ -19,8 +19,8 @@
#include "device.h"
#include "tools.h"
#define VDRVERSION "1.1.33"
#define VDRVERSNUM 10133 // Version * 10000 + Major * 100 + Minor
#define VDRVERSION "1.2.0pre1"
#define VDRVERSNUM 10200 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99
#define MAXLIFETIME 99

13
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.78 2003/05/18 14:10:25 kls Exp $
* $Id: eit.c 1.79 2003/05/29 15:04:10 kls Exp $
***************************************************************************/
#include "eit.h"
@ -1236,10 +1236,17 @@ void cSIProcessor::Action()
// wait until data becomes ready from the bitfilter
if (poll(pfd, NumUsedFilters, 1000) != 0)
{
for (int a = 0; a < NumUsedFilters ; a++)
for (int aa = 0; aa < NumUsedFilters; aa++)
{
if (pfd[a].revents & POLLIN)
if (pfd[aa].revents & POLLIN)
{
int a;
for (a = 0; a < MAX_FILTERS; a++) {
if (pfd[aa].fd == filters[a].handle)
break;
}
if (a >= MAX_FILTERS || !filters[a].inuse) // filter no longer available
continue;
// read section
unsigned char buf[4096]; // max. allowed size for any EIT section
int r = safe_read(filters[a].handle, buf, sizeof(buf));

View File

@ -7,7 +7,7 @@
/* X compile line: cc -o gentexfont gentexfont.c -lX11 */
/* 2000-10-01: Stripped down the original code to get a simple bitmap C-code generator */
/* for use with the VDR project (see http://www.cadsoft.de/people/kls/vdr) */
/* for use with the VDR project (see http://www.cadsoft.de/vdr) */
/* Renamed the file 'genfontfile.c' since it no longer generates 'tex' data */
/* Klaus Schmidinger (kls@cadsoft.de) */

330
i18n.c

File diff suppressed because it is too large Load Diff

10
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.249 2003/05/25 14:06:17 kls Exp $
* $Id: menu.c 1.253 2003/05/30 09:53:57 kls Exp $
*/
#include "menu.h"
@ -1862,6 +1862,11 @@ eOSState cMenuRecordings::Delete(void)
if (timer) {
timer->Skip();
cRecordControls::Process(time(NULL));
if (timer->IsSingleEvent()) {
int Index = timer->Index();
Timers.Del(timer);
isyslog("timer %d deleted", Index + 1);
}
Timers.Save();
}
}
@ -2636,7 +2641,8 @@ cDisplayChannel::cDisplayChannel(eKeys FirstKey)
lines = 0;
number = 0;
lastTime = time_ms();
int EpgLines = Setup.ShowInfoOnChSwitch ? 5 : 1;
withInfo = Setup.ShowInfoOnChSwitch;
int EpgLines = withInfo ? 5 : 1;
Interface->Open(Setup.OSDwidth, Setup.ChannelInfoPos ? EpgLines : -EpgLines);
ProcessKey(FirstKey);
}

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.79 2003/05/24 11:22:34 kls Exp $
* $Id: recording.c 1.80 2003/05/30 13:23:54 kls Exp $
*/
#include "recording.h"
@ -769,6 +769,12 @@ void cRecordingUserCommand::InvokeCommand(const char *State, const char *Recordi
#define INDEXFILESUFFIX "/index.vdr"
// The number of frames to stay off the end in case of time shift:
#define INDEXSAFETYLIMIT 100 // frames
// The maximum time to wait before giving up while catching up on an index file:
#define MAXINDEXCATCHUP 8 // seconds
// The minimum age of an index file for considering it no longer to be written:
#define MININDEXAGE 3600 // seconds
@ -852,47 +858,50 @@ bool cIndexFile::CatchUp(int Index)
{
// returns true unless something really goes wrong, so that 'index' becomes NULL
if (index && f >= 0) {
if (Index < 0 || Index >= last) {
struct stat buf;
if (fstat(f, &buf) == 0) {
if (time(NULL) - buf.st_mtime > MININDEXAGE) {
// apparently the index file is not being written any more
close(f);
f = -1;
return true;
}
int newLast = buf.st_size / sizeof(tIndex) - 1;
if (newLast > last) {
if (size <= newLast) {
size *= 2;
if (size <= newLast)
size = newLast + 1;
}
index = (tIndex *)realloc(index, size * sizeof(tIndex));
if (index) {
int offset = (last + 1) * sizeof(tIndex);
int delta = (newLast - last) * sizeof(tIndex);
if (lseek(f, offset, SEEK_SET) == offset) {
if (safe_read(f, &index[last + 1], delta) != delta) {
esyslog("ERROR: can't read from index");
free(index);
index = NULL;
close(f);
f = -1;
return true;
}
last = newLast;
}
else
LOG_ERROR_STR(fileName);
}
else
esyslog("ERROR: can't realloc() index");
}
}
else
LOG_ERROR_STR(fileName);
}
for (int i = 0; i <= MAXINDEXCATCHUP && (Index < 0 || Index >= last); i++) {
struct stat buf;
if (fstat(f, &buf) == 0) {
if (time(NULL) - buf.st_mtime > MININDEXAGE) {
// apparently the index file is not being written any more
close(f);
f = -1;
break;
}
int newLast = buf.st_size / sizeof(tIndex) - 1;
if (newLast > last) {
if (size <= newLast) {
size *= 2;
if (size <= newLast)
size = newLast + 1;
}
index = (tIndex *)realloc(index, size * sizeof(tIndex));
if (index) {
int offset = (last + 1) * sizeof(tIndex);
int delta = (newLast - last) * sizeof(tIndex);
if (lseek(f, offset, SEEK_SET) == offset) {
if (safe_read(f, &index[last + 1], delta) != delta) {
esyslog("ERROR: can't read from index");
free(index);
index = NULL;
close(f);
f = -1;
break;
}
last = newLast;
}
else
LOG_ERROR_STR(fileName);
}
else
esyslog("ERROR: can't realloc() index");
}
}
else
LOG_ERROR_STR(fileName);
if (Index < last - (i ? 2 * INDEXSAFETYLIMIT : 0) || Index > 10 * INDEXSAFETYLIMIT) // keep off the end in case of "Pause live video"
break;
sleep(1);
}
}
return index != NULL;
}
@ -940,7 +949,7 @@ int cIndexFile::GetNextIFrame(int Index, bool Forward, uchar *FileNumber, int *F
int d = Forward ? 1 : -1;
for (;;) {
Index += d;
if (Index >= 0 && Index < last - ((Forward && StayOffEnd) ? 100 : 0)) {
if (Index >= 0 && Index < last - ((Forward && StayOffEnd) ? INDEXSAFETYLIMIT : 0)) {
if (index[Index].type == I_FRAME) {
if (FileNumber)
*FileNumber = index[Index].number;

8
vdr.1
View File

@ -2,15 +2,15 @@
.\" ** The above line should force tbl to be a preprocessor **
.\" Man page for vdr
.\"
.\" Copyright (C) 2002 Klaus Schmidinger
.\" Copyright (C) 2003 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.7 2003/05/03 16:16:05 kls Exp $
.\" $Id: vdr.1 1.8 2003/05/29 11:58:28 kls Exp $
.\"
.TH vdr 1 "3 May 2003" "1.1.30" "Video Disk Recorder"
.TH vdr 1 "1 June 2003" "1.2.0" "Video Disk Recorder"
.SH NAME
vdr - the Video Disk Recorder
.SH SYNOPSIS
@ -185,7 +185,7 @@ 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.
Copyright \(co 2003 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.

12
vdr.5
View File

@ -2,15 +2,15 @@
.\" ** The above line should force tbl to be a preprocessor **
.\" Man page for vdr file formats
.\"
.\" Copyright (C) 2002 Klaus Schmidinger
.\" Copyright (C) 2003 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.18 2003/04/26 11:54:35 kls Exp $
.\" $Id: vdr.5 1.20 2003/05/29 11:58:57 kls Exp $
.\"
.TH vdr 5 "6 Dec 2002" "1.2.0" "Video Disk Recorder Files"
.TH vdr 5 "1 Jun 2003" "1.2.0" "Video Disk Recorder Files"
.SH NAME
vdr file formats - the Video Disk Recorder Files
.SH DESCRIPTION
@ -547,9 +547,7 @@ l l.
<channel name> @is the "name" as in 'channels.conf' (for information only, may be left out)
<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)
<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 (any '|' characters will be interpreted as newlines)
@ -564,7 +562,7 @@ Written by Klaus Schmidinger.
.SH REPORTING BUGS
Report bugs to <vdr-bugs@cadsoft.de>.
.SH COPYRIGHT
Copyright \(co 2002 Klaus Schmidinger.
Copyright \(co 2003 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.

6
vdr.c
View File

@ -1,7 +1,7 @@
/*
* vdr.c: Video Disk Recorder main program
*
* Copyright (C) 2000 Klaus Schmidinger
* Copyright (C) 2000, 2003 Klaus Schmidinger
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -20,9 +20,9 @@
*
* The author can be reached at kls@cadsoft.de
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.159 2003/05/24 15:17:38 kls Exp $
* $Id: vdr.c 1.160 2003/05/29 12:27:26 kls Exp $
*/
#include <getopt.h>