Version 1.1.2

- Changed the cPlugin::Start() function to return a boolean value that indicates
  if the plugin will not be able to perform its task (suggested by Stefan Huelswitt).
- Added the cPlugin::Housekeeping() function (suggested by Stefan Huelswitt).
- Updated channels.conf.cable (thanks to Uwe Scheffler).
- Added 'insert' capabilities to cList (suggested by Stefan Huelswitt).
- Changed the 'package' target in the plugin's Makefile to produce a package that
  expands to a directory with just the plugin name and version number (suggested
  by Stefan Huelswitt).
- Made the config directory available to plugins (suggested by Stefan Huelswitt).
  See PLUGINS.html, section "Configuration files" for details.
- Improved the [eid]syslog() macros, so that the LOG_... macros don't need to be
  given any more.
This commit is contained in:
Klaus Schmidinger 2002-05-13 18:00:00 +02:00
parent 803c6c6bf6
commit d07e3829f7
31 changed files with 556 additions and 301 deletions

View File

@ -130,6 +130,13 @@ Stefan Huelswitt <huels@iname.com>
doing shutdown or housekeeping doing shutdown or housekeeping
for making the cList template class avoid ambiguities in case one defines a "list of for making the cList template class avoid ambiguities in case one defines a "list of
lists" lists"
for suggesting to make the cPlugin::Start() function return a boolean value that
indicates if the plugin will not be able to perform its task
for suggesting to add the cPlugin::Housekeeping() function
for suggesting to add 'insert' capabilities to cList
for suggesting to make 'package' target in the plugin's Makefile produce a package that
expands to a directory with just the plugin name and version number
for suggesting to make the config directory available to plugins
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than for pointing out that there are channels that have a symbol rate higher than

15
HISTORY
View File

@ -1269,3 +1269,18 @@ Video Disk Recorder Revision History
- Fixed logging error message for unknown config parameters in plugins. - Fixed logging error message for unknown config parameters in plugins.
- Rearranged cleanup sequence at the end of the main program. - Rearranged cleanup sequence at the end of the main program.
- Adapted PLUGINS.html to use the actual code examples from the 'hello' plugin. - Adapted PLUGINS.html to use the actual code examples from the 'hello' plugin.
2002-05-13: Version 1.1.2
- Changed the cPlugin::Start() function to return a boolean value that indicates
if the plugin will not be able to perform its task (suggested by Stefan Huelswitt).
- Added the cPlugin::Housekeeping() function (suggested by Stefan Huelswitt).
- Updated channels.conf.cable (thanks to Uwe Scheffler).
- Added 'insert' capabilities to cList (suggested by Stefan Huelswitt).
- Changed the 'package' target in the plugin's Makefile to produce a package that
expands to a directory with just the plugin name and version number (suggested
by Stefan Huelswitt).
- Made the config directory available to plugins (suggested by Stefan Huelswitt).
See PLUGINS.html, section "Configuration files" for details.
- Improved the [eid]syslog() macros, so that the LOG_... macros don't need to be
given any more.

View File

@ -16,9 +16,12 @@ This document describes the "outside" interface of the plugin system.
It handles everything necessary for a plugin to get hooked into the core It handles everything necessary for a plugin to get hooked into the core
VDR program and present itself to the user. VDR program and present itself to the user.
<p> <p>
<!--X1.1.1--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%> <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.1 are marked like this. Important modifications introduced in version 1.1.1 are marked like this.
<!--X1.1.1--></td></tr></table> <!--X1.1.1--></td></tr></table>
<!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.2 are marked like this.
<!--X1.1.2--></td></tr></table>
<!--<p>TODO: Link to the document about VDR base classes to use when implementing actual functionality (yet to be written).--> <!--<p>TODO: Link to the document about VDR base classes to use when implementing actual functionality (yet to be written).-->
<hr><h2>Quick start</h2> <hr><h2>Quick start</h2>
@ -114,21 +117,25 @@ from the web, it will typically have a name like
<p> <p>
and will unpack into a directory named and will unpack into a directory named
<p> <p>
<tt>vdr-hello-0.0.1</tt> <!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
<tt>hello-0.0.1</tt>
<!--X1.1.2--></td></tr></table>
<p> <p>
To use the <tt>plugins</tt> and <tt>plugins-clean</tt> targets from the VDR <tt>Makefile</tt> To use the <tt>plugins</tt> and <tt>plugins-clean</tt> targets from the VDR <tt>Makefile</tt>
you need to unpack such an archive into the <tt>VDR/PLUGINS/SRC</tt> directory and you need to unpack such an archive into the <tt>VDR/PLUGINS/SRC</tt> directory and
create a symbolic link with the basic plugin name, as in create a symbolic link with the basic plugin name, as in
<!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br> <p><table><tr><td bgcolor=#F0F0F0><pre><br>
ln -s vdr-hello-0.0.1 hello ln -s hello-0.0.1 hello
</pre></td></tr></table><p> </pre></td></tr></table><p>
Since the VDR <tt>Makefile</tt> only searches for directories with names consisting Since the VDR <tt>Makefile</tt> only searches for directories with names consisting
of only lowercase characters and digits, it will only follow the symbolic links, which of only lowercase characters and digits, it will only follow the symbolic links, which
should lead to the current version of the plugin you want to use. This way you can should lead to the current version of the plugin you want to use. This way you can
have several different versions of a plugin source (like <tt>vdr-hello-0.0.1</tt> and have several different versions of a plugin source (like <tt>hello-0.0.1</tt> and
<tt>vdr-hello-0.0.2</tt>) and define which one to actually use through the symbolic link. <tt>hello-0.0.2</tt>) and define which one to actually use through the symbolic link.
<!--X1.1.2--></td></tr></table>
<a name="Initializing a new plugin directory"><hr><h2>Initializing a new plugin directory</h2> <a name="Initializing a new plugin directory"><hr><h2>Initializing a new plugin directory</h2>
@ -184,7 +191,7 @@ its memory. You don't need to worry about the details behind all this.
If your plugin requires additional source files, simply add them to your plugin's If your plugin requires additional source files, simply add them to your plugin's
source directory and adjust the <tt>Makefile</tt> accordingly. source directory and adjust the <tt>Makefile</tt> accordingly.
<p> <p>
<!--X1.1.1--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%> <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan>&nbsp;</td><td width=100%>
Header files usually contain preprocessor statements that prevent the same Header files usually contain preprocessor statements that prevent the same
file (or rather its contents, to be precise) from being included more than once, like file (or rather its contents, to be precise) from being included more than once, like
@ -403,9 +410,11 @@ If a plugin implements a function that runs in the background (presumably in a
thread of its own), or wants to make use of <a href="#Internationalization">internationalization</a>, thread of its own), or wants to make use of <a href="#Internationalization">internationalization</a>,
it needs to implement the function it needs to implement the function
<!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br> <p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual void Start(void); virtual bool Start(void);
</pre></td></tr></table><p> </pre></td></tr></table><p>
<!--X1.1.2--></td></tr></table>
which is called once for each plugin at program startup. which is called once for each plugin at program startup.
Inside this function the plugin must set up everything necessary to perform Inside this function the plugin must set up everything necessary to perform
@ -413,6 +422,13 @@ its task. This may, for instance, be a thread that collects data from the DVB
stream, which is later presented to the user via a function that is available stream, which is later presented to the user via a function that is available
from the main menu. from the main menu.
<p> <p>
<!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
A return value of <i>false</i> indicates that something has gone wrong and the
plugin will not be able to perform its task. In that case, the plugin should
write a proper error message to the log file. The first plugin that returns
<i>false</i> from its <tt>Start()</tt> function will cause VDR to exit.
<!--X1.1.2--></td></tr></table>
<p>
If the plugin doesn't implement any background functionality or internationalized If the plugin doesn't implement any background functionality or internationalized
texts, it doesn't need to implement this function. texts, it doesn't need to implement this function.
@ -470,7 +486,34 @@ interaction is possible. If a specific action takes longer than a few seconds,
the plugin should launch a separate thread to do this. the plugin should launch a separate thread to do this.
</b> </b>
<hr><h2>Setup parameters</h2> <!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
<hr><h2>Housekeeping</h2>
<center><i><b>Chores, chores...</b></i></center><p>
From time to time a plugin may want to do some regular tasks, like cleaning
up some files or other things. In order to do this it can implement the function
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual void Housekeeping(void);
</pre></td></tr></table><p>
which gets called when VDR is otherwise idle. The intervals between subsequent
calls to this function are not defined. There may be several hours between two
calls (if, for instance, there are recordings or replays going on) or they may
be as close as ten seconds. The only thing that is guaranteed is that there are
at least ten seconds between two subsequent calls to the <tt>Housekeeping()</tt>
function of the same plugin.
<p>
<b>
It is very important that a call to <tt>Housekeeping()</tt> returns as soon
as possible! As long as the program stays inside this function, no other user
interaction is possible. If a specific action takes longer than a few seconds,
the plugin should launch a separate thread to do this.
</b>
<!--X1.1.2--></td></tr></table>
<a name="Setup parameters"><hr><h2>Setup parameters</h2>
<center><i><b>Remember me...</b></i></center><p> <center><i><b>Remember me...</b></i></center><p>
@ -490,7 +533,7 @@ previously stored in the global setup data (see below). It shall return
<i>true</i> if the parameter was parsed correctly, <i>false</i> in case of <i>true</i> if the parameter was parsed correctly, <i>false</i> in case of
an error. If <i>false</i> is returned, an error message will be written to an error. If <i>false</i> is returned, an error message will be written to
the log file (and program execution will continue). the log file (and program execution will continue).
<!--X1.1.1--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%> <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan>&nbsp;</td><td width=100%>
A possible implementation of <tt>SetupParse()</tt> could look like this: A possible implementation of <tt>SetupParse()</tt> could look like this:
<p><table><tr><td bgcolor=#F0F0F0><pre><br> <p><table><tr><td bgcolor=#F0F0F0><pre><br>
@ -545,7 +588,7 @@ needs setup parameters that are not directly user adjustable. It can use
<tt>SetupStore()</tt> and <tt>SetupParse()</tt> without presenting these <tt>SetupStore()</tt> and <tt>SetupParse()</tt> without presenting these
parameters to the user. parameters to the user.
<!--X1.1.1--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%> <!--X1.1.1--><table width=100%><tr><td bgcolor=cyan>&nbsp;</td><td width=100%>
<a name="The Setup menu"><hr><h2>The Setup menu</h2> <a name="The Setup menu"><hr><h2>The Setup menu</h2>
<center><i><b>Have it your way!</b></i></center><p> <center><i><b>Have it your way!</b></i></center><p>
@ -605,6 +648,63 @@ your setup parameters and use that one to copy all parameters with one single st
(like VDR does with its cSetup class). (like VDR does with its cSetup class).
<!--X1.1.1--></td></tr></table> <!--X1.1.1--></td></tr></table>
<!--X1.1.2--><table width=100%><tr><td bgcolor=red>&nbsp;</td><td width=100%>
<hr><h2>Configuration files</h2>
<center><i><b>I want my own stuff!</b></i></center><p>
There may be situations where a plugin requires configuration files of its own, maybe
for data that can't be stored in the simple <a href="#Setup parameters">setup parameters</a>
of VDR, or maybe because it needs to launch other programs that simply need a separate
configuration file. While the plugin is free to store such files anywhere it
sees fit, it might be a good idea to put them in a common place, preferably
where other configuration data already exists. VDR provides the function
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
const char *ConfigDirectory(const char *PluginName = NULL);
</pre></td></tr></table><p>
which returns a string containing the directory that VDR uses for its own configuration
files (defined through the <tt><b>-c</b></tt> option in the call to VDR), extended by
<tt>"/plugins"</tt>. So assuming the VDR configuration directory is <tt>/video</tt>
(the default if no <tt><b>-c</b></tt> or <tt><b>-v</b></tt> option is given),
a call to <tt>ConfigDirectory()</tt> will return <tt>/video/plugins</tt>. The first
call to <tt>ConfigDirectory()</tt> will automatically make sure that the <tt>plugins</tt>
subdirectory will exist. If, for some reason, this cannot be achieved, <tt>NULL</tt>
will be returned.
<p>
The additional <tt>plugins</tt> directory is used to keep files from plugins apart
from those of VDR itself, making sure there will be no name clashes. If a plugin
needs only one extra configuration file, it is suggested that this file be named
<tt>name.conf</tt>, where <i>name</i> shall be the name of the plugin.
<p>
If a plugin needs more than one such file, it is suggested that the plugin stores
these in a subdirectory of its own, named after the plugin. To easily get such a name
the <tt>ConfigDirectory()</tt> function can be given an additional string that will
be appended to the returned directory name, as in
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
const char *MyConfigDir = ConfigDirectory(Name());
</pre></td></tr></table><p>
where <tt>Name()</tt> is the member function of the plugin class that returns the
plugin's name. Again, VDR will make sure that the requested directory will exist
(or return <tt>NULL</tt> in case of an error).
<p>
<b>
The returned string is statically allocated and will be overwritten by subsequent
calls to ConfigDirectory()!
</b>
<p>
The <tt>ConfigDirectory()</tt> function is a static member function of the <tt>cPlugin</tt>
class. This allows it to be called even from outside any member function of the derived
plugin class, by writing
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
const char *MyConfigDir = cPlugin::ConfigDirectory();
</pre></td></tr></table><p>
<!--X1.1.2--></td></tr></table>
<a name="Internationalization"><hr><h2>Internationalization</h2> <a name="Internationalization"><hr><h2>Internationalization</h2>
<center><i><b>Welcome to Babylon!</b></i></center><p> <center><i><b>Welcome to Babylon!</b></i></center><p>

View File

@ -8,3 +8,9 @@ VDR Plugin 'hello' Revision History
2002-05-11: Version 0.0.2 2002-05-11: Version 0.0.2
- Added setup parameters and a Setup menu to adjust them. - Added setup parameters and a Setup menu to adjust them.
2002-05-12: Version 0.0.3
- Changed return type of cPluginHello::Start().
- Added cPluginHello::Housekeeping().
- Modified package generation.

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # Makefile for a Video Disk Recorder plugin
# #
# $Id: Makefile 1.1 2002/05/09 15:17:44 kls Exp $ # $Id: Makefile 1.2 2002/05/12 15:09:07 kls Exp $
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -27,7 +27,8 @@ VDRVERSION = `grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }'
### The name of the distribution archive: ### The name of the distribution archive:
ARCHIVE = vdr-$(PLUGIN)-$(VERSION) ARCHIVE = $(PLUGIN)-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here): ### Includes and Defines (add further entries here):
@ -70,9 +71,9 @@ package: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE) @mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE) @cp -a * $(TMPDIR)/$(ARCHIVE)
@tar czf $(ARCHIVE).tgz -C $(TMPDIR) $(ARCHIVE) @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE) @-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution archive created as $(ARCHIVE).tgz @echo Distribution package created as $(PACKAGE).tgz
clean: clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: hello.c 1.2 2002/05/11 14:17:20 kls Exp $ * $Id: hello.c 1.4 2002/05/12 10:18:59 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -11,7 +11,7 @@
#include <vdr/plugin.h> #include <vdr/plugin.h>
#include "i18n.h" #include "i18n.h"
static const char *VERSION = "0.0.2"; static const char *VERSION = "0.0.3";
static const char *DESCRIPTION = "A friendly greeting"; static const char *DESCRIPTION = "A friendly greeting";
static const char *MAINMENUENTRY = "Hello"; static const char *MAINMENUENTRY = "Hello";
@ -27,7 +27,8 @@ public:
virtual const char *Description(void) { return tr(DESCRIPTION); } virtual const char *Description(void) { return tr(DESCRIPTION); }
virtual const char *CommandLineHelp(void); virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]); virtual bool ProcessArgs(int argc, char *argv[]);
virtual void Start(void); virtual bool Start(void);
virtual void Housekeeping(void);
virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); } virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
virtual cOsdMenu *MainMenuAction(void); virtual cOsdMenu *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void); virtual cMenuSetupPage *SetupMenu(void);
@ -110,10 +111,16 @@ bool cPluginHello::ProcessArgs(int argc, char *argv[])
return true; return true;
} }
void cPluginHello::Start(void) bool cPluginHello::Start(void)
{ {
// Start any background activities the plugin shall perform. // Start any background activities the plugin shall perform.
RegisterI18n(Phrases); RegisterI18n(Phrases);
return true;
}
void cPluginHello::Housekeeping(void)
{
// Perform any cleanup or other regular tasks.
} }
cOsdMenu *cPluginHello::MainMenuAction(void) cOsdMenu *cPluginHello::MainMenuAction(void)

View File

@ -45,7 +45,7 @@ Disney Channel:402:C:0:6900:1030:1034:0:101:34
Discovery Channel:378:C:0:6900:1791:1792:0:101:14 Discovery Channel:378:C:0:6900:1791:1792:0:101:14
Fox Kids:354:C:0:6900:1279:1280:0:101:28 Fox Kids:354:C:0:6900:1279:1280:0:101:28
Junior:354:C:0:6900:255:256:0:101:19 Junior:354:C:0:6900:255:256:0:101:19
K-TOON:354:C:0:6900:0:0:0:101:12 K-TOON:354:C:0:6900:511:512:0:101:12
GOLDSTAR TV:354:C:0:6900:3839:3840:0:101:518 GOLDSTAR TV:354:C:0:6900:3839:3840:0:101:518
CLASSICA:354:C:0:6900:767:768:0:101:15 CLASSICA:354:C:0:6900:767:768:0:101:15
:Mediavision :Mediavision
@ -54,7 +54,7 @@ Fashion TV:346:h:0:6900:821:822:0:101:50702
Einstein:346:h:0:6900:623:624:0:101:50719 Einstein:346:h:0:6900:623:624:0:101:50719
Extreme Sport:346:h:0:6900:801:802:0:101:50700 Extreme Sport:346:h:0:6900:801:802:0:101:50700
LANDSCAPE:346:h:0:6900:831:832:0:101:50703 LANDSCAPE:346:h:0:6900:831:832:0:101:50703
Single TV:346:h:0:6900:621:622:0:101:50706 Single TV:346:h:0:6900:525:526:0:101:50706
Leitseite:346:h:0:6900:2254:0:0:0:5004 Leitseite:346:h:0:6900:2254:0:0:0:5004
BET ON JAZZ:346:h:0:6900:841:842:0:101:50704 BET ON JAZZ:346:h:0:6900:841:842:0:101:50704
:Digit. Bouquet"Kabel Berlin" :Digit. Bouquet"Kabel Berlin"
@ -84,9 +84,28 @@ ZEE TV:442:h:0:6900:517:773:0:101:53301
NTV i:442:h:0:6900:514:515:0:101:53302 NTV i:442:h:0:6900:514:515:0:101:53302
ATV:434:h:0:6900:631:632:0:0:53203 ATV:434:h:0:6900:631:632:0:0:53203
TW1:610:h:0:6900:6106:6107:0:0:6106 TW1:610:h:0:6900:6106:6107:0:0:6106
Channel71:386:C:0:6900:1791:1792:0:101:33
:Premiere Sport :Premiere Sport
PREMIERE SPORT 1:362:C:0:6900:255:256,257:0:101:17 PREMIERE SPORT 1:362:C:0:6900:255:256,257:0:101:17
PREMIERE SPORT 2:378:C:0:6900:3839:3840,3841:0:101:27 PREMIERE SPORT 2:378:C:0:6900:3839:3840,3841:0:101:27
:Premiere Bundesliga
Bundesliga Konferenz:378:C:0:6900:2303:2304,2305:0:101:210
Bundesliga Spiel 1:362:C:0:6900:255:256,257:0:101:17
Bundesliga Spiel 2:362:C:0:6900:2047:2048,2049:0:101:240
Bundesliga Spiel 3:362:C:0:6900:2303:2304,2305:0:101:241
Bundesliga Spiel 4:362:C:0:6900:2559:2560,2561:0:101:242
Bundesliga Spiel 5:362:C:0:6900:2815:2816,2817:0:101:243
Bundesliga Spiel 6:362:C:0:6900:3071:3072,3073:0:101:244
Bundesliga Spiel 7:362:C:0:6900:3327:3328,3329:0:101:245
Bundesliga Spiel 8:378:C:0:6900:3071:3072,3073:0:101:208
Bundesliga Spiel 9:378:C:0:6900:3327:3328,3329:0:101:209
:Premiere Formel 1
F1 Multi:362:h:0:6900:255:256,257:0:101:17
F1 Supersignal:386:h:0:6900:255:256,257:0:101:211
F1 Cockpit:386:h:0:6900:511:512,513:0:101:212
F1 Boxen:386:h:0:6900:767:768,769:0:101:213
F1 Verfolger:386:h:0:6900:1023:1024,1025:0:101:214
F1 Info:386:h:0:6900:1279:1280,1281:0:101:215
:Premiere Direkt 1 :Premiere Direkt 1
PREMIERE DIREKT 1A:362:C:0:6900:1023:1024,1025:0:101:182 PREMIERE DIREKT 1A:362:C:0:6900:1023:1024,1025:0:101:182
PREMIERE DIREKT 1B:378:C:0:6900:511:512,513:0:101:177 PREMIERE DIREKT 1B:378:C:0:6900:511:512,513:0:101:177

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 1.100 2002/05/11 12:05:22 kls Exp $ * $Id: config.c 1.101 2002/05/13 16:28:12 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -72,7 +72,7 @@ void cKeys::SetDummyValues(void)
bool cKeys::Load(const char *FileName) bool cKeys::Load(const char *FileName)
{ {
isyslog(LOG_INFO, "loading %s", FileName); isyslog("loading %s", FileName);
bool result = false; bool result = false;
if (FileName) if (FileName)
fileName = strdup(FileName); fileName = strdup(FileName);
@ -105,7 +105,7 @@ bool cKeys::Load(const char *FileName)
} }
} }
if (Name) { if (Name) {
esyslog(LOG_ERR, "unknown key in %s, line %d\n", fileName, line); esyslog("unknown key in %s, line %d\n", fileName, line);
result = false; result = false;
break; break;
} }
@ -113,7 +113,7 @@ bool cKeys::Load(const char *FileName)
} }
continue; continue;
} }
esyslog(LOG_ERR, "error in %s, line %d\n", fileName, line); esyslog("error in %s, line %d\n", fileName, line);
result = false; result = false;
break; break;
} }
@ -121,10 +121,10 @@ bool cKeys::Load(const char *FileName)
fclose(f); fclose(f);
} }
else else
esyslog(LOG_ERR, "can't open '%s'\n", fileName); esyslog("can't open '%s'\n", fileName);
} }
else else
esyslog(LOG_ERR, "no key configuration file name supplied!\n"); esyslog("no key configuration file name supplied!\n");
return result; return result;
} }
@ -299,7 +299,7 @@ bool cChannel::Switch(cDvbApi *DvbApi, bool Log)
DvbApi = cDvbApi::PrimaryDvbApi; DvbApi = cDvbApi::PrimaryDvbApi;
if (!DvbApi->Recording() && !groupSep) { if (!DvbApi->Recording() && !groupSep) {
if (Log) if (Log)
isyslog(LOG_INFO, "switching to channel %d", number); isyslog("switching to channel %d", number);
for (int i = 3; i--;) { for (int i = 3; i--;) {
switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) { switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) {
case scrOk: return true; case scrOk: return true;
@ -308,7 +308,7 @@ bool cChannel::Switch(cDvbApi *DvbApi, bool Log)
return false; return false;
case scrFailed: break; // loop will retry case scrFailed: break; // loop will retry
} }
esyslog(LOG_ERR, "retrying"); esyslog("retrying");
} }
return false; return false;
} }
@ -637,7 +637,7 @@ time_t cTimer::StopTime(void)
void cTimer::SetRecording(bool Recording) void cTimer::SetRecording(bool Recording)
{ {
recording = Recording; recording = Recording;
isyslog(LOG_INFO, "timer %d %s", Index() + 1, recording ? "start" : "stop"); isyslog("timer %d %s", Index() + 1, recording ? "start" : "stop");
} }
void cTimer::SetPending(bool Pending) void cTimer::SetPending(bool Pending)
@ -684,7 +684,7 @@ bool cCommand::Parse(const char *s)
const char *cCommand::Execute(void) const char *cCommand::Execute(void)
{ {
dsyslog(LOG_INFO, "executing command '%s'", command); dsyslog("executing command '%s'", command);
delete result; delete result;
result = NULL; result = NULL;
FILE *p = popen(command, "r"); FILE *p = popen(command, "r");
@ -701,7 +701,7 @@ const char *cCommand::Execute(void)
pclose(p); pclose(p);
} }
else else
esyslog(LOG_ERR, "ERROR: can't open pipe for command '%s'", command); esyslog("ERROR: can't open pipe for command '%s'", command);
return result; return result;
} }
@ -1084,7 +1084,7 @@ bool cSetup::Load(const char *FileName)
error = true; error = true;
} }
if (error) { if (error) {
esyslog(LOG_ERR, "ERROR: unknown config parameter: %s%s%s = %s", l->Plugin() ? l->Plugin() : "", l->Plugin() ? "." : "", l->Name(), l->Value()); esyslog("ERROR: unknown config parameter: %s%s%s = %s", l->Plugin() ? l->Plugin() : "", l->Plugin() ? "." : "", l->Name(), l->Value());
result = false; result = false;
} }
} }
@ -1225,7 +1225,7 @@ bool cSetup::Save(void)
Sort(); Sort();
if (cConfig<cSetupLine>::Save()) { if (cConfig<cSetupLine>::Save()) {
isyslog(LOG_INFO, "saved setup to %s", FileName()); isyslog("saved setup to %s", FileName());
return true; return true;
} }
return false; return false;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 1.114 2002/05/10 13:48:00 kls Exp $ * $Id: config.h 1.116 2002/05/13 16:28:16 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.1.1" #define VDRVERSION "1.1.2"
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99
@ -227,7 +227,7 @@ public:
fileName = strdup(FileName); fileName = strdup(FileName);
bool result = false; bool result = false;
if (access(FileName, F_OK) == 0) { if (access(FileName, F_OK) == 0) {
isyslog(LOG_INFO, "loading %s", FileName); isyslog("loading %s", FileName);
FILE *f = fopen(fileName, "r"); FILE *f = fopen(fileName, "r");
if (f) { if (f) {
int line = 0; int line = 0;
@ -245,7 +245,7 @@ public:
if (l->Parse(buffer)) if (l->Parse(buffer))
Add(l); Add(l);
else { else {
esyslog(LOG_ERR, "error in %s, line %d\n", fileName, line); esyslog("error in %s, line %d\n", fileName, line);
delete l; delete l;
result = false; result = false;
break; break;

126
dvbapi.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbapi.c 1.174 2002/05/03 15:59:32 kls Exp $ * $Id: dvbapi.c 1.175 2002/05/13 16:29:17 kls Exp $
*/ */
#include "dvbapi.h" #include "dvbapi.h"
@ -137,7 +137,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
delta = buf.st_size % sizeof(tIndex); delta = buf.st_size % sizeof(tIndex);
if (delta) { if (delta) {
delta = sizeof(tIndex) - delta; delta = sizeof(tIndex) - delta;
esyslog(LOG_ERR, "ERROR: invalid file size (%ld) in '%s'", buf.st_size, fileName); esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, fileName);
} }
last = (buf.st_size + delta) / sizeof(tIndex) - 1; last = (buf.st_size + delta) / sizeof(tIndex) - 1;
if (!Record && last >= 0) { if (!Record && last >= 0) {
@ -147,7 +147,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
f = open(fileName, O_RDONLY); f = open(fileName, O_RDONLY);
if (f >= 0) { if (f >= 0) {
if ((int)safe_read(f, index, buf.st_size) != buf.st_size) { if ((int)safe_read(f, index, buf.st_size) != buf.st_size) {
esyslog(LOG_ERR, "ERROR: can't read from file '%s'", fileName); esyslog("ERROR: can't read from file '%s'", fileName);
delete index; delete index;
index = NULL; index = NULL;
close(f); close(f);
@ -159,18 +159,18 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
} }
else else
esyslog(LOG_ERR, "ERROR: can't allocate %d bytes for index '%s'", size * sizeof(tIndex), fileName); esyslog("ERROR: can't allocate %d bytes for index '%s'", size * sizeof(tIndex), fileName);
} }
} }
else else
LOG_ERROR; LOG_ERROR;
} }
else if (!Record) else if (!Record)
isyslog(LOG_INFO, "missing index file %s", fileName); isyslog("missing index file %s", fileName);
if (Record) { if (Record) {
if ((f = open(fileName, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) >= 0) { if ((f = open(fileName, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) >= 0) {
if (delta) { if (delta) {
esyslog(LOG_ERR, "ERROR: padding index file with %d '0' bytes", delta); esyslog("ERROR: padding index file with %d '0' bytes", delta);
while (delta--) while (delta--)
writechar(f, 0); writechar(f, 0);
} }
@ -180,7 +180,7 @@ cIndexFile::cIndexFile(const char *FileName, bool Record)
} }
} }
else else
esyslog(LOG_ERR, "ERROR: can't copy file name '%s'", FileName); esyslog("ERROR: can't copy file name '%s'", FileName);
} }
} }
@ -211,7 +211,7 @@ bool cIndexFile::CatchUp(int Index)
int delta = (newLast - last) * sizeof(tIndex); int delta = (newLast - last) * sizeof(tIndex);
if (lseek(f, offset, SEEK_SET) == offset) { if (lseek(f, offset, SEEK_SET) == offset) {
if (safe_read(f, &index[last + 1], delta) != delta) { if (safe_read(f, &index[last + 1], delta) != delta) {
esyslog(LOG_ERR, "ERROR: can't read from index"); esyslog("ERROR: can't read from index");
delete index; delete index;
index = NULL; index = NULL;
close(f); close(f);
@ -224,7 +224,7 @@ bool cIndexFile::CatchUp(int Index)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
} }
else else
esyslog(LOG_ERR, "ERROR: can't realloc() index"); esyslog("ERROR: can't realloc() index");
} }
} }
else else
@ -300,7 +300,7 @@ int cIndexFile::GetNextIFrame(int Index, bool Forward, uchar *FileNumber, int *F
if (fn == *FileNumber) if (fn == *FileNumber)
*Length = fo - *FileOffset; *Length = fo - *FileOffset;
else { else {
esyslog(LOG_ERR, "ERROR: 'I' frame at end of file #%d", *FileNumber); esyslog("ERROR: 'I' frame at end of file #%d", *FileNumber);
*Length = -1; *Length = -1;
} }
} }
@ -358,7 +358,7 @@ cFileName::cFileName(const char *FileName, bool Record, bool Blocking)
// Prepare the file name: // Prepare the file name:
fileName = new char[strlen(FileName) + RECORDFILESUFFIXLEN]; fileName = new char[strlen(FileName) + RECORDFILESUFFIXLEN];
if (!fileName) { if (!fileName) {
esyslog(LOG_ERR, "ERROR: can't copy file name '%s'", fileName); esyslog("ERROR: can't copy file name '%s'", fileName);
return; return;
} }
strcpy(fileName, FileName); strcpy(fileName, FileName);
@ -377,14 +377,14 @@ int cFileName::Open(void)
if (file < 0) { if (file < 0) {
int BlockingFlag = blocking ? 0 : O_NONBLOCK; int BlockingFlag = blocking ? 0 : O_NONBLOCK;
if (record) { if (record) {
dsyslog(LOG_INFO, "recording to '%s'", fileName); dsyslog("recording to '%s'", fileName);
file = OpenVideoFile(fileName, O_RDWR | O_CREAT | BlockingFlag); file = OpenVideoFile(fileName, O_RDWR | O_CREAT | BlockingFlag);
if (file < 0) if (file < 0)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
} }
else { else {
if (access(fileName, R_OK) == 0) { if (access(fileName, R_OK) == 0) {
dsyslog(LOG_INFO, "playing '%s'", fileName); dsyslog("playing '%s'", fileName);
file = open(fileName, O_RDONLY | BlockingFlag); file = open(fileName, O_RDONLY | BlockingFlag);
if (file < 0) if (file < 0)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
@ -429,7 +429,7 @@ int cFileName::SetOffset(int Number, int Offset)
} }
return file; return file;
} }
esyslog(LOG_ERR, "ERROR: max number of files (%d) exceeded", MAXFILESPERRECORDING); esyslog("ERROR: max number of files (%d) exceeded", MAXFILESPERRECORDING);
return -1; return -1;
} }
@ -479,7 +479,7 @@ cRecordBuffer::cRecordBuffer(cDvbApi *DvbApi, const char *FileName, int VPid, in
// Create the index file: // Create the index file:
index = new cIndexFile(FileName, true); index = new cIndexFile(FileName, true);
if (!index) if (!index)
esyslog(LOG_ERR, "ERROR: can't allocate index"); esyslog("ERROR: can't allocate index");
// let's continue without index, so we'll at least have the recording // let's continue without index, so we'll at least have the recording
videoDev = dvbApi->SetModeRecord(); videoDev = dvbApi->SetModeRecord();
Start(); Start();
@ -498,7 +498,7 @@ bool cRecordBuffer::RunningLowOnDiskSpace(void)
int Free = FreeDiskSpaceMB(fileName.Name()); int Free = FreeDiskSpaceMB(fileName.Name());
lastDiskSpaceCheck = time(NULL); lastDiskSpaceCheck = time(NULL);
if (Free < MINFREEDISKSPACE) { if (Free < MINFREEDISKSPACE) {
dsyslog(LOG_INFO, "low disk space (%d MB, limit is %d MB)", Free, MINFREEDISKSPACE); dsyslog("low disk space (%d MB, limit is %d MB)", Free, MINFREEDISKSPACE);
return true; return true;
} }
} }
@ -518,7 +518,7 @@ bool cRecordBuffer::NextFile(void)
void cRecordBuffer::Input(void) void cRecordBuffer::Input(void)
{ {
dsyslog(LOG_INFO, "input thread started (pid=%d)", getpid()); dsyslog("input thread started (pid=%d)", getpid());
uchar b[MINVIDEODATA]; uchar b[MINVIDEODATA];
time_t t = time(NULL); time_t t = time(NULL);
@ -540,7 +540,7 @@ void cRecordBuffer::Input(void)
else if (r < 0) { else if (r < 0) {
if (FATALERRNO) { if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__); esyslog("ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else { else {
LOG_ERROR; LOG_ERROR;
break; break;
@ -549,7 +549,7 @@ void cRecordBuffer::Input(void)
} }
} }
if (time(NULL) - t > MAXBROKENTIMEOUT) { if (time(NULL) - t > MAXBROKENTIMEOUT) {
esyslog(LOG_ERR, "ERROR: video data stream broken"); esyslog("ERROR: video data stream broken");
cThread::EmergencyExit(true); cThread::EmergencyExit(true);
t = time(NULL); t = time(NULL);
} }
@ -557,12 +557,12 @@ void cRecordBuffer::Input(void)
break; break;
} }
dsyslog(LOG_INFO, "input thread ended (pid=%d)", getpid()); dsyslog("input thread ended (pid=%d)", getpid());
} }
void cRecordBuffer::Output(void) void cRecordBuffer::Output(void)
{ {
dsyslog(LOG_INFO, "output thread started (pid=%d)", getpid()); dsyslog("output thread started (pid=%d)", getpid());
uchar b[MINVIDEODATA]; uchar b[MINVIDEODATA];
int r = 0; int r = 0;
@ -601,7 +601,7 @@ void cRecordBuffer::Output(void)
} }
recording = false; recording = false;
dsyslog(LOG_INFO, "output thread ended (pid=%d)", getpid()); dsyslog("output thread ended (pid=%d)", getpid());
} }
// --- ReadFrame ------------------------------------------------------------- // --- ReadFrame -------------------------------------------------------------
@ -611,7 +611,7 @@ int ReadFrame(int f, uchar *b, int Length, int Max)
if (Length == -1) if (Length == -1)
Length = Max; // this means we read up to EOF (see cIndex) Length = Max; // this means we read up to EOF (see cIndex)
else if (Length > Max) { else if (Length > Max) {
esyslog(LOG_ERR, "ERROR: frame larger than buffer (%d > %d)", Length, Max); esyslog("ERROR: frame larger than buffer (%d > %d)", Length, Max);
Length = Max; Length = Max;
} }
int r = safe_read(f, b, Length); int r = safe_read(f, b, Length);
@ -751,7 +751,7 @@ void cPlayBuffer::PlayExternalDolby(const uchar *b, int MaxLength)
{ {
if (cDvbApi::AudioCommand()) { if (cDvbApi::AudioCommand()) {
if (!dolbyDev && !dolbyDev.Open(cDvbApi::AudioCommand(), "w")) { if (!dolbyDev && !dolbyDev.Open(cDvbApi::AudioCommand(), "w")) {
esyslog(LOG_ERR, "ERROR: can't open pipe to audio command '%s'", cDvbApi::AudioCommand()); esyslog("ERROR: can't open pipe to audio command '%s'", cDvbApi::AudioCommand());
return; return;
} }
if (b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01) { if (b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01) {
@ -775,7 +775,7 @@ void cPlayBuffer::PlayExternalDolby(const uchar *b, int MaxLength)
void cPlayBuffer::Output(void) void cPlayBuffer::Output(void)
{ {
dsyslog(LOG_INFO, "output thread started (pid=%d)", getpid()); dsyslog("output thread started (pid=%d)", getpid());
while (Busy()) { while (Busy()) {
if (blockOutput) { if (blockOutput) {
@ -812,7 +812,7 @@ void cPlayBuffer::Output(void)
} }
} }
dsyslog(LOG_INFO, "output thread ended (pid=%d)", getpid()); dsyslog("output thread ended (pid=%d)", getpid());
} }
void cPlayBuffer::putFrame(cFrame *Frame) void cPlayBuffer::putFrame(cFrame *Frame)
@ -1051,7 +1051,7 @@ cReplayBuffer::cReplayBuffer(cDvbApi *DvbApi, int VideoDev, int AudioDev, const
// Create the index file: // Create the index file:
index = new cIndexFile(FileName, false); index = new cIndexFile(FileName, false);
if (!index) if (!index)
esyslog(LOG_ERR, "ERROR: can't allocate index"); esyslog("ERROR: can't allocate index");
else if (!index->Ok()) { else if (!index->Ok()) {
delete index; delete index;
index = NULL; index = NULL;
@ -1072,11 +1072,11 @@ cReplayBuffer::~cReplayBuffer()
void cReplayBuffer::Input(void) void cReplayBuffer::Input(void)
{ {
dsyslog(LOG_INFO, "input thread started (pid=%d)", getpid()); dsyslog("input thread started (pid=%d)", getpid());
readIndex = Resume(); readIndex = Resume();
if (readIndex >= 0) if (readIndex >= 0)
isyslog(LOG_INFO, "resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true)); isyslog("resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true));
uchar b[MAXFRAMESIZE]; uchar b[MAXFRAMESIZE];
while (Busy() && (blockInput || NextFile())) { while (Busy() && (blockInput || NextFile())) {
@ -1134,7 +1134,7 @@ void cReplayBuffer::Input(void)
usleep(1); // this keeps the CPU load low usleep(1); // this keeps the CPU load low
} }
dsyslog(LOG_INFO, "input thread ended (pid=%d)", getpid()); dsyslog("input thread ended (pid=%d)", getpid());
} }
void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except) void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except)
@ -1161,7 +1161,7 @@ void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except)
case 0xE0 ... 0xEF: // video case 0xE0 ... 0xEF: // video
break; break;
default: default:
//esyslog(LOG_ERR, "ERROR: unexpected packet id %02X", c); //esyslog("ERROR: unexpected packet id %02X", c);
l = 0; l = 0;
} }
if (l) if (l)
@ -1169,7 +1169,7 @@ void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except)
} }
/*XXX /*XXX
else else
esyslog(LOG_ERR, "ERROR: broken packet header"); esyslog("ERROR: broken packet header");
XXX*/ XXX*/
} }
} }
@ -1370,7 +1370,7 @@ void cTransferBuffer::SetAudioPid(int APid)
void cTransferBuffer::Input(void) void cTransferBuffer::Input(void)
{ {
dsyslog(LOG_INFO, "input thread started (pid=%d)", getpid()); dsyslog("input thread started (pid=%d)", getpid());
uchar b[MINVIDEODATA]; uchar b[MINVIDEODATA];
int n = 0; int n = 0;
@ -1396,7 +1396,7 @@ void cTransferBuffer::Input(void)
else if (r < 0) { else if (r < 0) {
if (FATALERRNO) { if (FATALERRNO) {
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__); esyslog("ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
else { else {
LOG_ERROR; LOG_ERROR;
break; break;
@ -1406,12 +1406,12 @@ void cTransferBuffer::Input(void)
} }
} }
dsyslog(LOG_INFO, "input thread ended (pid=%d)", getpid()); dsyslog("input thread ended (pid=%d)", getpid());
} }
void cTransferBuffer::Output(void) void cTransferBuffer::Output(void)
{ {
dsyslog(LOG_INFO, "output thread started (pid=%d)", getpid()); dsyslog("output thread started (pid=%d)", getpid());
uchar b[MINVIDEODATA]; uchar b[MINVIDEODATA];
while (Busy()) { while (Busy()) {
@ -1443,7 +1443,7 @@ void cTransferBuffer::Output(void)
usleep(1); // this keeps the CPU load low usleep(1); // this keeps the CPU load low
} }
dsyslog(LOG_INFO, "output thread ended (pid=%d)", getpid()); dsyslog("output thread ended (pid=%d)", getpid());
} }
// --- cCuttingBuffer -------------------------------------------------------- // --- cCuttingBuffer --------------------------------------------------------
@ -1480,7 +1480,7 @@ cCuttingBuffer::cCuttingBuffer(const char *FromFileName, const char *ToFileName)
Start(); Start();
} }
else else
esyslog(LOG_ERR, "no editing marks found for %s", FromFileName); esyslog("no editing marks found for %s", FromFileName);
} }
cCuttingBuffer::~cCuttingBuffer() cCuttingBuffer::~cCuttingBuffer()
@ -1495,7 +1495,7 @@ cCuttingBuffer::~cCuttingBuffer()
void cCuttingBuffer::Action(void) void cCuttingBuffer::Action(void)
{ {
dsyslog(LOG_INFO, "video cutting thread started (pid=%d)", getpid()); dsyslog("video cutting thread started (pid=%d)", getpid());
cMark *Mark = fromMarks.First(); cMark *Mark = fromMarks.First();
if (Mark) { if (Mark) {
@ -1596,8 +1596,8 @@ void cCuttingBuffer::Action(void)
} }
} }
else else
esyslog(LOG_ERR, "no editing marks found!"); esyslog("no editing marks found!");
dsyslog(LOG_INFO, "end video cutting thread"); dsyslog("end video cutting thread");
} }
// --- cVideoCutter ---------------------------------------------------------- // --- cVideoCutter ----------------------------------------------------------
@ -1644,9 +1644,9 @@ void cVideoCutter::Stop(void)
cuttingBuffer = NULL; cuttingBuffer = NULL;
if ((Interrupted || Error) && editedVersionName) { if ((Interrupted || Error) && editedVersionName) {
if (Interrupted) if (Interrupted)
isyslog(LOG_INFO, "editing process has been interrupted"); isyslog("editing process has been interrupted");
if (Error) if (Error)
esyslog(LOG_ERR, "ERROR: '%s' during editing process", Error); esyslog("ERROR: '%s' during editing process", Error);
RemoveVideoFile(editedVersionName); //XXX what if this file is currently being replayed? RemoveVideoFile(editedVersionName); //XXX what if this file is currently being replayed?
} }
} }
@ -1755,7 +1755,7 @@ cDvbApi::cDvbApi(int n)
frontendType = feinfo.type; frontendType = feinfo.type;
} }
else else
esyslog(LOG_ERR, "ERROR: can't open video device %d", n); esyslog("ERROR: can't open video device %d", n);
cols = rows = 0; cols = rows = 0;
#if defined(DEBUG_OSD) || defined(REMOTE_KBD) #if defined(DEBUG_OSD) || defined(REMOTE_KBD)
@ -1803,11 +1803,11 @@ bool cDvbApi::SetPrimaryDvbApi(int n)
{ {
n--; n--;
if (0 <= n && n < NumDvbApis && dvbApi[n]) { if (0 <= n && n < NumDvbApis && dvbApi[n]) {
isyslog(LOG_INFO, "setting primary DVB to %d", n + 1); isyslog("setting primary DVB to %d", n + 1);
PrimaryDvbApi = dvbApi[n]; PrimaryDvbApi = dvbApi[n];
return true; return true;
} }
esyslog(LOG_ERR, "invalid DVB interface: %d", n + 1); esyslog("invalid DVB interface: %d", n + 1);
return false; return false;
} }
@ -1906,7 +1906,7 @@ int cDvbApi::ProvidesCa(int Ca)
bool cDvbApi::Probe(const char *FileName) bool cDvbApi::Probe(const char *FileName)
{ {
if (access(FileName, F_OK) == 0) { if (access(FileName, F_OK) == 0) {
dsyslog(LOG_INFO, "probing %s", FileName); dsyslog("probing %s", FileName);
int f = open(FileName, O_RDONLY); int f = open(FileName, O_RDONLY);
if (f >= 0) { if (f >= 0) {
close(f); close(f);
@ -1933,9 +1933,9 @@ bool cDvbApi::Init(void)
} }
PrimaryDvbApi = dvbApi[0]; PrimaryDvbApi = dvbApi[0];
if (NumDvbApis > 0) if (NumDvbApis > 0)
isyslog(LOG_INFO, "found %d video device%s", NumDvbApis, NumDvbApis > 1 ? "s" : ""); isyslog("found %d video device%s", NumDvbApis, NumDvbApis > 1 ? "s" : "");
else else
esyslog(LOG_ERR, "ERROR: no video device found, giving up!"); esyslog("ERROR: no video device found, giving up!");
SetCaCaps(); SetCaCaps();
return NumDvbApis > 0; return NumDvbApis > 0;
} }
@ -1990,7 +1990,7 @@ bool cDvbApi::GrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX,
if (Quality < 0) if (Quality < 0)
Quality = 255; //XXX is this 'best'??? Quality = 255; //XXX is this 'best'???
isyslog(LOG_INFO, "grabbing to %s (%s %d %d %d)", FileName, Jpeg ? "JPEG" : "PNM", Quality, vm.width, vm.height); isyslog("grabbing to %s (%s %d %d %d)", FileName, Jpeg ? "JPEG" : "PNM", Quality, vm.width, vm.height);
FILE *f = fopen(FileName, "wb"); FILE *f = fopen(FileName, "wb");
if (f) { if (f) {
if (Jpeg) { if (Jpeg) {
@ -2446,7 +2446,7 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int Frequency, char Pol
} }
break; break;
default: default:
esyslog(LOG_ERR, "ERROR: attempt to set channel with unknown DVB frontend type"); esyslog("ERROR: attempt to set channel with unknown DVB frontend type");
return scrFailed; return scrFailed;
} }
@ -2461,22 +2461,22 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int Frequency, char Pol
int res = ioctl(fd_frontend, FE_GET_EVENT, &event); int res = ioctl(fd_frontend, FE_GET_EVENT, &event);
if (res >= 0) { if (res >= 0) {
if (event.type != FE_COMPLETION_EV) { if (event.type != FE_COMPLETION_EV) {
esyslog(LOG_ERR, "ERROR: channel %d not sync'ed on DVB card %d!", ChannelNumber, CardIndex() + 1); esyslog("ERROR: channel %d not sync'ed on DVB card %d!", ChannelNumber, CardIndex() + 1);
if (this == PrimaryDvbApi) if (this == PrimaryDvbApi)
cThread::RaisePanic(); cThread::RaisePanic();
return scrFailed; return scrFailed;
} }
} }
else else
esyslog(LOG_ERR, "ERROR %d in frontend get event (channel %d, card %d)", res, ChannelNumber, CardIndex() + 1); esyslog("ERROR %d in frontend get event (channel %d, card %d)", res, ChannelNumber, CardIndex() + 1);
} }
else else
esyslog(LOG_ERR, "ERROR: timeout while tuning"); esyslog("ERROR: timeout while tuning");
// PID settings: // PID settings:
if (!SetPids(false)) { if (!SetPids(false)) {
esyslog(LOG_ERR, "ERROR: failed to set PIDs for channel %d", ChannelNumber); esyslog("ERROR: failed to set PIDs for channel %d", ChannelNumber);
return scrFailed; return scrFailed;
} }
SetTpid(Tpid, DMX_OUT_DECODER); SetTpid(Tpid, DMX_OUT_DECODER);
@ -2563,7 +2563,7 @@ bool cDvbApi::Replaying(void)
bool cDvbApi::StartRecord(const char *FileName, int Ca, int Priority) bool cDvbApi::StartRecord(const char *FileName, int Ca, int Priority)
{ {
if (Recording()) { if (Recording()) {
esyslog(LOG_ERR, "ERROR: StartRecord() called while recording - ignored!"); esyslog("ERROR: StartRecord() called while recording - ignored!");
return false; return false;
} }
@ -2574,10 +2574,10 @@ bool cDvbApi::StartRecord(const char *FileName, int Ca, int Priority)
// Check FileName: // Check FileName:
if (!FileName) { if (!FileName) {
esyslog(LOG_ERR, "ERROR: StartRecord: file name is (null)"); esyslog("ERROR: StartRecord: file name is (null)");
return false; return false;
} }
isyslog(LOG_INFO, "record %s", FileName); isyslog("record %s", FileName);
// Create directories if necessary: // Create directories if necessary:
@ -2598,7 +2598,7 @@ bool cDvbApi::StartRecord(const char *FileName, int Ca, int Priority)
return true; return true;
} }
else else
esyslog(LOG_ERR, "ERROR: can't allocate recording buffer"); esyslog("ERROR: can't allocate recording buffer");
return false; return false;
} }
@ -2616,7 +2616,7 @@ void cDvbApi::StopRecord(void)
bool cDvbApi::StartReplay(const char *FileName) bool cDvbApi::StartReplay(const char *FileName)
{ {
if (Recording()) { if (Recording()) {
esyslog(LOG_ERR, "ERROR: StartReplay() called while recording - ignored!"); esyslog("ERROR: StartReplay() called while recording - ignored!");
return false; return false;
} }
StopTransfer(); StopTransfer();
@ -2626,10 +2626,10 @@ bool cDvbApi::StartReplay(const char *FileName)
// Check FileName: // Check FileName:
if (!FileName) { if (!FileName) {
esyslog(LOG_ERR, "ERROR: StartReplay: file name is (null)"); esyslog("ERROR: StartReplay: file name is (null)");
return false; return false;
} }
isyslog(LOG_INFO, "replay %s", FileName); isyslog("replay %s", FileName);
// Create replay buffer: // Create replay buffer:
@ -2637,7 +2637,7 @@ bool cDvbApi::StartReplay(const char *FileName)
if (replayBuffer) if (replayBuffer)
return true; return true;
else else
esyslog(LOG_ERR, "ERROR: can't allocate replaying buffer"); esyslog("ERROR: can't allocate replaying buffer");
} }
return false; return false;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbosd.c 1.14 2002/05/10 14:22:04 kls Exp $ * $Id: dvbosd.c 1.15 2002/05/13 16:29:20 kls Exp $
*/ */
#include "dvbosd.h" #include "dvbosd.h"
@ -18,7 +18,7 @@ cDvbOsd::cDvbOsd(int VideoDev, int x, int y)
{ {
videoDev = VideoDev; videoDev = VideoDev;
if (videoDev < 0) if (videoDev < 0)
esyslog(LOG_ERR, "ERROR: illegal video device handle (%d)!", videoDev); esyslog("ERROR: illegal video device handle (%d)!", videoDev);
} }
cDvbOsd::~cDvbOsd() cDvbOsd::~cDvbOsd()
@ -37,7 +37,7 @@ bool cDvbOsd::SetWindow(cWindow *Window)
Cmd(OSD_SetWindow, 0, Handle + 1); Cmd(OSD_SetWindow, 0, Handle + 1);
return true; return true;
} }
esyslog(LOG_ERR, "ERROR: illegal window handle: %d", Handle); esyslog("ERROR: illegal window handle: %d", Handle);
} }
return false; return false;
} }

62
eit.c
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: eit.c 1.44 2002/04/06 13:58:59 kls Exp $ * $Id: eit.c 1.45 2002/05/13 16:35:49 kls Exp $
***************************************************************************/ ***************************************************************************/
#include "eit.h" #include "eit.h"
@ -117,7 +117,7 @@ void cMJD::ConvertToTime()
mjdtime = timegm(&t); mjdtime = timegm(&t);
//isyslog(LOG_INFO, "Time parsed = %s\n", ctime(&mjdtime)); //isyslog("Time parsed = %s\n", ctime(&mjdtime));
} }
/** */ /** */
@ -132,10 +132,10 @@ bool cMJD::SetSystemTime()
if (abs(mjdtime - loctim) > 2) if (abs(mjdtime - loctim) > 2)
{ {
isyslog(LOG_INFO, "System Time = %s (%ld)\n", ctime(&loctim), loctim); isyslog("System Time = %s (%ld)\n", ctime(&loctim), loctim);
isyslog(LOG_INFO, "Local Time = %s (%ld)\n", ctime(&mjdtime), mjdtime); isyslog("Local Time = %s (%ld)\n", ctime(&mjdtime), mjdtime);
if (stime(&mjdtime) < 0) if (stime(&mjdtime) < 0)
esyslog(LOG_ERR, "ERROR while setting system time: %m"); esyslog("ERROR while setting system time: %m");
return true; return true;
} }
@ -391,11 +391,11 @@ bool cEventInfo::Read(FILE *f, cSchedule *Schedule)
break; break;
case 'c': // to keep things simple we react on 'c' here case 'c': // to keep things simple we react on 'c' here
return true; return true;
default: esyslog(LOG_ERR, "ERROR: unexpected tag while reading EPG data: %s", s); default: esyslog("ERROR: unexpected tag while reading EPG data: %s", s);
return false; return false;
} }
} }
esyslog(LOG_ERR, "ERROR: unexpected end of file while reading EPG data"); esyslog("ERROR: unexpected end of file while reading EPG data");
} }
return false; return false;
} }
@ -436,14 +436,14 @@ static void ReportEpgBugFixStats(bool Reset = false)
tEpgBugFixStats *p = &EpgBugFixStats[i]; tEpgBugFixStats *p = &EpgBugFixStats[i];
if (p->hits) { if (p->hits) {
if (!GotHits) { if (!GotHits) {
dsyslog(LOG_INFO, "====================="); dsyslog("=====================");
dsyslog(LOG_INFO, "EPG bugfix statistics"); dsyslog("EPG bugfix statistics");
dsyslog(LOG_INFO, "====================="); dsyslog("=====================");
dsyslog(LOG_INFO, "IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED"); dsyslog("IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED");
dsyslog(LOG_INFO, "CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()"); dsyslog("CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()");
dsyslog(LOG_INFO, "IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!"); dsyslog("IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog(LOG_INFO, "====================="); dsyslog("=====================");
dsyslog(LOG_INFO, "Fix\tHits\tChannels"); dsyslog("Fix\tHits\tChannels");
GotHits = true; GotHits = true;
} }
char *q = buffer; char *q = buffer;
@ -455,13 +455,13 @@ static void ReportEpgBugFixStats(bool Reset = false)
delim = ", "; delim = ", ";
} }
} }
dsyslog(LOG_INFO, "%s", buffer); dsyslog("%s", buffer);
} }
if (Reset) if (Reset)
p->hits = p->n = 0; p->hits = p->n = 0;
} }
if (GotHits) if (GotHits)
dsyslog(LOG_INFO, "====================="); dsyslog("=====================");
} }
} }
@ -760,7 +760,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
} }
} }
else { else {
esyslog(LOG_ERR, "ERROR: unexpected tag while reading EPG data: %s", s); esyslog("ERROR: unexpected tag while reading EPG data: %s", s);
return false; return false;
} }
} }
@ -1015,7 +1015,7 @@ bool cSIProcessor::Read(FILE *f)
if (OwnFile) { if (OwnFile) {
const char *FileName = GetEpgDataFileName(); const char *FileName = GetEpgDataFileName();
if (access(FileName, R_OK) == 0) { if (access(FileName, R_OK) == 0) {
dsyslog(LOG_INFO, "reading EPG data from %s", FileName); dsyslog("reading EPG data from %s", FileName);
if ((f = fopen(FileName, "r")) == NULL) { if ((f = fopen(FileName, "r")) == NULL) {
LOG_ERROR; LOG_ERROR;
return false; return false;
@ -1065,7 +1065,7 @@ information and let the classes corresponding
to the tables write their information to the disk */ to the tables write their information to the disk */
void cSIProcessor::Action() void cSIProcessor::Action()
{ {
dsyslog(LOG_INFO, "EIT processing thread started (pid=%d)%s", getpid(), masterSIProcessor ? " - master" : ""); dsyslog("EIT processing thread started (pid=%d)%s", getpid(), masterSIProcessor ? " - master" : "");
time_t lastCleanup = time(NULL); time_t lastCleanup = time(NULL);
time_t lastDump = time(NULL); time_t lastDump = time(NULL);
@ -1082,7 +1082,7 @@ void cSIProcessor::Action()
if (now - lastCleanup > 3600 && ptm->tm_hour == 5) if (now - lastCleanup > 3600 && ptm->tm_hour == 5)
{ {
cMutexLock MutexLock(&schedulesMutex); cMutexLock MutexLock(&schedulesMutex);
isyslog(LOG_INFO, "cleaning up schedules data"); isyslog("cleaning up schedules data");
schedules->Cleanup(); schedules->Cleanup();
lastCleanup = now; lastCleanup = now;
ReportEpgBugFixStats(true); ReportEpgBugFixStats(true);
@ -1131,7 +1131,7 @@ void cSIProcessor::Action()
if (n == seclen) if (n == seclen)
{ {
seclen += 3; seclen += 3;
//dsyslog(LOG_INFO, "Received pid 0x%02x with table ID 0x%02x and length of %04d\n", pid, buf[0], seclen); //dsyslog("Received pid 0x%02x with table ID 0x%02x and length of %04d\n", pid, buf[0], seclen);
switch (pid) switch (pid)
{ {
case 0x14: case 0x14:
@ -1145,7 +1145,7 @@ void cSIProcessor::Action()
} }
/*XXX this comes pretty often: /*XXX this comes pretty often:
else else
dsyslog(LOG_INFO, "Time packet was not 0x70 but 0x%02x\n", (int)buf[0]); dsyslog("Time packet was not 0x70 but 0x%02x\n", (int)buf[0]);
XXX*/ XXX*/
break; break;
@ -1157,7 +1157,7 @@ void cSIProcessor::Action()
ceit.ProcessEIT(buf); ceit.ProcessEIT(buf);
} }
else else
dsyslog(LOG_INFO, "Received stuffing section in EIT\n"); dsyslog("Received stuffing section in EIT\n");
break; break;
default: default:
@ -1166,7 +1166,7 @@ void cSIProcessor::Action()
} }
/*XXX this just fills up the log file - shouldn't we rather try to re-sync? /*XXX this just fills up the log file - shouldn't we rather try to re-sync?
else else
dsyslog(LOG_INFO, "read incomplete section - seclen = %d, n = %d", seclen, n); dsyslog("read incomplete section - seclen = %d, n = %d", seclen, n);
XXX*/ XXX*/
} }
} }
@ -1174,7 +1174,7 @@ void cSIProcessor::Action()
} }
} }
dsyslog(LOG_INFO, "EIT processing thread ended (pid=%d)%s", getpid(), masterSIProcessor ? " - master" : ""); dsyslog("EIT processing thread ended (pid=%d)%s", getpid(), masterSIProcessor ? " - master" : "");
} }
/** Add a filter with packet identifier pid and /** Add a filter with packet identifier pid and
@ -1202,21 +1202,21 @@ bool cSIProcessor::AddFilter(u_char pid, u_char tid)
filters[a].inuse = true; filters[a].inuse = true;
else else
{ {
esyslog(LOG_ERR, "ERROR: can't set filter"); esyslog("ERROR: can't set filter");
close(filters[a].handle); close(filters[a].handle);
return false; return false;
} }
// dsyslog(LOG_INFO, " Registered filter handle %04x, pid = %02d, tid = %02d", filters[a].handle, filters[a].pid, filters[a].tid); // dsyslog("Registered filter handle %04x, pid = %02d, tid = %02d", filters[a].handle, filters[a].pid, filters[a].tid);
} }
else else
{ {
esyslog(LOG_ERR, "ERROR: can't open filter handle"); esyslog("ERROR: can't open filter handle");
return false; return false;
} }
return true; return true;
} }
} }
esyslog(LOG_ERR, "ERROR: too many filters"); esyslog("ERROR: too many filters");
return false; return false;
} }
@ -1229,7 +1229,7 @@ bool cSIProcessor::ShutDownFilters(void)
if (filters[a].inuse) if (filters[a].inuse)
{ {
close(filters[a].handle); close(filters[a].handle);
// dsyslog(LOG_INFO, "Deregistered filter handle %04x, pid = %02d, tid = %02d", filters[a].handle, filters[a].pid, filters[a].tid); // dsyslog("Deregistered filter handle %04x, pid = %02d, tid = %02d", filters[a].handle, filters[a].pid, filters[a].tid);
filters[a].inuse = false; filters[a].inuse = false;
} }
} }

4
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: i18n.c 1.88 2002/05/11 11:43:38 kls Exp $ * $Id: i18n.c 1.89 2002/05/13 16:30:00 kls Exp $
* *
* Translations provided by: * Translations provided by:
* *
@ -2495,7 +2495,7 @@ const char *I18nTranslate(const char *s, const char *Plugin)
} }
p = Phrases; p = Phrases;
} }
esyslog(LOG_ERR, "%s%sno translation found for '%s' in language %d (%s)\n", Plugin ? Plugin : "", Plugin ? ": " : "", s, Setup.OSDLanguage, Phrases[0][Setup.OSDLanguage]); esyslog("%s%sno translation found for '%s' in language %d (%s)\n", Plugin ? Plugin : "", Plugin ? ": " : "", s, Setup.OSDLanguage, Phrases[0][Setup.OSDLanguage]);
} }
const char *p = strchr(s, '$'); const char *p = strchr(s, '$');
return p ? p + 1 : s; return p ? p + 1 : s;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: interface.c 1.47 2002/01/27 15:48:46 kls Exp $ * $Id: interface.c 1.48 2002/05/13 16:30:22 kls Exp $
*/ */
#include "interface.h" #include "interface.h"
@ -303,7 +303,7 @@ void cInterface::Status(const char *s, eDvbColor FgColor, eDvbColor BgColor)
void cInterface::Info(const char *s) void cInterface::Info(const char *s)
{ {
Open(Setup.OSDwidth, -1); Open(Setup.OSDwidth, -1);
isyslog(LOG_INFO, "info: %s", s); isyslog("info: %s", s);
Status(s, clrBlack, clrGreen); Status(s, clrBlack, clrGreen);
Wait(); Wait();
Status(NULL); Status(NULL);
@ -313,7 +313,7 @@ void cInterface::Info(const char *s)
void cInterface::Error(const char *s) void cInterface::Error(const char *s)
{ {
Open(Setup.OSDwidth, -1); Open(Setup.OSDwidth, -1);
esyslog(LOG_ERR, "ERROR: %s", s); esyslog("ERROR: %s", s);
Status(s, clrWhite, clrRed); Status(s, clrWhite, clrRed);
Wait(); Wait();
Status(NULL); Status(NULL);
@ -323,13 +323,13 @@ void cInterface::Error(const char *s)
bool cInterface::Confirm(const char *s, int Seconds, bool WaitForTimeout) bool cInterface::Confirm(const char *s, int Seconds, bool WaitForTimeout)
{ {
Open(Setup.OSDwidth, -1); Open(Setup.OSDwidth, -1);
isyslog(LOG_INFO, "confirm: %s", s); isyslog("confirm: %s", s);
Status(s, clrBlack, clrYellow); Status(s, clrBlack, clrYellow);
eKeys k = Wait(Seconds); eKeys k = Wait(Seconds);
bool result = WaitForTimeout ? k == kNone : k == kOk; bool result = WaitForTimeout ? k == kNone : k == kOk;
Status(NULL); Status(NULL);
Close(); Close();
isyslog(LOG_INFO, "%sconfirmed", result ? "" : "not "); isyslog("%sconfirmed", result ? "" : "not ");
return result; return result;
} }
@ -441,7 +441,7 @@ void cInterface::QueryKeys(void)
void cInterface::LearnKeys(void) void cInterface::LearnKeys(void)
{ {
isyslog(LOG_INFO, "learning keys"); isyslog("learning keys");
Open(); Open();
for (;;) { for (;;) {
Clear(); Clear();

48
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.191 2002/05/11 11:16:32 kls Exp $ * $Id: menu.c 1.192 2002/05/13 16:30:50 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -514,7 +514,7 @@ eOSState cMenuChannels::Edit(void)
{ {
if (HasSubMenu() || Count() == 0) if (HasSubMenu() || Count() == 0)
return osContinue; return osContinue;
isyslog(LOG_INFO, "editing channel %d", Current() + 1); isyslog("editing channel %d", Current() + 1);
return AddSubMenu(new cMenuEditChannel(Current())); return AddSubMenu(new cMenuEditChannel(Current()));
} }
@ -527,7 +527,7 @@ eOSState cMenuChannels::New(void)
Channels.ReNumber(); Channels.ReNumber();
Add(new cMenuChannelItem(channel->Index()/*XXX*/, channel), true); Add(new cMenuChannelItem(channel->Index()/*XXX*/, channel), true);
Channels.Save(); Channels.Save();
isyslog(LOG_INFO, "channel %d added", channel->number); isyslog("channel %d added", channel->number);
return AddSubMenu(new cMenuEditChannel(Current())); return AddSubMenu(new cMenuEditChannel(Current()));
} }
@ -553,7 +553,7 @@ eOSState cMenuChannels::Del(void)
for (cMenuChannelItem *ci = (cMenuChannelItem *)First(); ci; ci = (cMenuChannelItem *)ci->Next()) for (cMenuChannelItem *ci = (cMenuChannelItem *)First(); ci; ci = (cMenuChannelItem *)ci->Next())
ci->SetIndex(i++); ci->SetIndex(i++);
Channels.Save(); Channels.Save();
isyslog(LOG_INFO, "channel %d deleted", DeletedChannel); isyslog("channel %d deleted", DeletedChannel);
// Fix the timers: // Fix the timers:
bool TimersModified = false; bool TimersModified = false;
for (cTimer *ti = Timers.First(); ti; ti = (cTimer *)ti->Next()) { for (cTimer *ti = Timers.First(); ti; ti = (cTimer *)ti->Next()) {
@ -562,7 +562,7 @@ eOSState cMenuChannels::Del(void)
ti->channel--; ti->channel--;
if (ti->channel != OldChannel) { if (ti->channel != OldChannel) {
TimersModified = true; TimersModified = true;
isyslog(LOG_INFO, "timer %d: channel changed from %d to %d", ti->Index() + 1, OldChannel, ti->channel); isyslog("timer %d: channel changed from %d to %d", ti->Index() + 1, OldChannel, ti->channel);
} }
} }
if (TimersModified) if (TimersModified)
@ -585,7 +585,7 @@ void cMenuChannels::Move(int From, int To)
for (cMenuChannelItem *ci = (cMenuChannelItem *)First(); ci; ci = (cMenuChannelItem *)ci->Next()) for (cMenuChannelItem *ci = (cMenuChannelItem *)First(); ci; ci = (cMenuChannelItem *)ci->Next())
ci->SetIndex(i++); ci->SetIndex(i++);
Channels.Save(); Channels.Save();
isyslog(LOG_INFO, "channel %d moved to %d", FromNumber, ToNumber); isyslog("channel %d moved to %d", FromNumber, ToNumber);
// Fix the timers: // Fix the timers:
bool TimersModified = false; bool TimersModified = false;
From++; // user visible channel numbers start with '1' From++; // user visible channel numbers start with '1'
@ -600,7 +600,7 @@ void cMenuChannels::Move(int From, int To)
ti->channel++; ti->channel++;
if (ti->channel != OldChannel) { if (ti->channel != OldChannel) {
TimersModified = true; TimersModified = true;
isyslog(LOG_INFO, "timer %d: channel changed from %d to %d", ti->Index() + 1, OldChannel, ti->channel); isyslog("timer %d: channel changed from %d to %d", ti->Index() + 1, OldChannel, ti->channel);
} }
} }
if (TimersModified) if (TimersModified)
@ -714,7 +714,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key)
if (timer->active) if (timer->active)
timer->active = 1; // allows external programs to mark active timers with values > 1 and recognize if the user has modified them timer->active = 1; // allows external programs to mark active timers with values > 1 and recognize if the user has modified them
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive"); isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
} }
return osBack; return osBack;
case kRed: case kRed:
@ -822,9 +822,9 @@ eOSState cMenuTimers::OnOff(void)
RefreshCurrent(); RefreshCurrent();
DisplayCurrent(true); DisplayCurrent(true);
if (timer->firstday) if (timer->firstday)
isyslog(LOG_INFO, "timer %d first day set to %s", timer->Index() + 1, timer->PrintFirstDay()); isyslog("timer %d first day set to %s", timer->Index() + 1, timer->PrintFirstDay());
else else
isyslog(LOG_INFO, "timer %d %sactivated", timer->Index() + 1, timer->active ? "" : "de"); isyslog("timer %d %sactivated", timer->Index() + 1, timer->active ? "" : "de");
Timers.Save(); Timers.Save();
} }
return osContinue; return osContinue;
@ -834,7 +834,7 @@ eOSState cMenuTimers::Edit(void)
{ {
if (HasSubMenu() || Count() == 0) if (HasSubMenu() || Count() == 0)
return osContinue; return osContinue;
isyslog(LOG_INFO, "editing timer %d", CurrentTimer()->Index() + 1); isyslog("editing timer %d", CurrentTimer()->Index() + 1);
return AddSubMenu(new cMenuEditTimer(CurrentTimer()->Index())); return AddSubMenu(new cMenuEditTimer(CurrentTimer()->Index()));
} }
@ -846,7 +846,7 @@ eOSState cMenuTimers::New(void)
Timers.Add(timer); Timers.Add(timer);
Add(new cMenuTimerItem(timer), true); Add(new cMenuTimerItem(timer), true);
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1); isyslog("timer %d added", timer->Index() + 1);
return AddSubMenu(new cMenuEditTimer(timer->Index(), true)); return AddSubMenu(new cMenuEditTimer(timer->Index(), true));
} }
@ -862,7 +862,7 @@ eOSState cMenuTimers::Del(void)
cOsdMenu::Del(Current()); cOsdMenu::Del(Current());
Timers.Save(); Timers.Save();
Display(); Display();
isyslog(LOG_INFO, "timer %d deleted", Index + 1); isyslog("timer %d deleted", Index + 1);
} }
} }
else else
@ -877,7 +877,7 @@ void cMenuTimers::Move(int From, int To)
cOsdMenu::Move(From, To); cOsdMenu::Move(From, To);
Timers.Save(); Timers.Save();
Display(); Display();
isyslog(LOG_INFO, "timer %d moved to %d", From + 1, To + 1); isyslog("timer %d moved to %d", From + 1, To + 1);
} }
eOSState cMenuTimers::Summary(void) eOSState cMenuTimers::Summary(void)
@ -1068,7 +1068,7 @@ eOSState cMenuWhatsOn::Record(void)
if (!t) { if (!t) {
Timers.Add(timer); Timers.Add(timer);
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1); isyslog("timer %d added", timer->Index() + 1);
} }
else { else {
delete timer; delete timer;
@ -1201,7 +1201,7 @@ eOSState cMenuSchedule::Record(void)
if (!t) { if (!t) {
Timers.Add(timer); Timers.Add(timer);
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1); isyslog("timer %d added", timer->Index() + 1);
} }
else { else {
delete timer; delete timer;
@ -2426,7 +2426,7 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer)
Title = eventInfo->GetTitle(); Title = eventInfo->GetTitle();
Subtitle = eventInfo->GetSubtitle(); Subtitle = eventInfo->GetSubtitle();
Summary = eventInfo->GetExtendedDescription(); Summary = eventInfo->GetExtendedDescription();
dsyslog(LOG_INFO, "Title: '%s' Subtitle: '%s'", Title, Subtitle); dsyslog("Title: '%s' Subtitle: '%s'", Title, Subtitle);
} }
cRecording Recording(timer, Title, Subtitle, Summary); cRecording Recording(timer, Title, Subtitle, Summary);
fileName = strdup(Recording.FileName()); fileName = strdup(Recording.FileName());
@ -2462,17 +2462,17 @@ bool cRecordControl::GetEventInfo(void)
eventInfo = Schedule->GetEventAround(Time); eventInfo = Schedule->GetEventAround(Time);
if (eventInfo) { if (eventInfo) {
if (seconds > 0) if (seconds > 0)
dsyslog(LOG_INFO, "got EPG info after %d seconds", seconds); dsyslog("got EPG info after %d seconds", seconds);
return true; return true;
} }
} }
} }
} }
if (seconds == 0) if (seconds == 0)
dsyslog(LOG_INFO, "waiting for EPG info..."); dsyslog("waiting for EPG info...");
sleep(1); sleep(1);
} }
dsyslog(LOG_INFO, "no EPG info available"); dsyslog("no EPG info available");
return false; return false;
} }
@ -2484,7 +2484,7 @@ void cRecordControl::Stop(bool KeepInstant)
if ((IsInstant() && !KeepInstant) || (timer->IsSingleEvent() && !timer->Matches())) { if ((IsInstant() && !KeepInstant) || (timer->IsSingleEvent() && !timer->Matches())) {
// checking timer->Matches() to make sure we don't delete the timer // checking timer->Matches() to make sure we don't delete the timer
// if the program was cancelled before the timer's stop time! // if the program was cancelled before the timer's stop time!
isyslog(LOG_INFO, "deleting timer %d", timer->Index() + 1); isyslog("deleting timer %d", timer->Index() + 1);
Timers.Del(timer); Timers.Del(timer);
Timers.Save(); Timers.Save();
} }
@ -2523,10 +2523,10 @@ bool cRecordControls::Start(cTimer *Timer)
} }
} }
else if (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending)) else if (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending))
isyslog(LOG_ERR, "no free DVB device to record channel %d!", ch); isyslog("no free DVB device to record channel %d!", ch);
} }
else else
esyslog(LOG_ERR, "ERROR: channel %d not defined!", ch); esyslog("ERROR: channel %d not defined!", ch);
return false; return false;
} }
@ -2546,7 +2546,7 @@ void cRecordControls::Stop(cDvbApi *DvbApi)
for (int i = 0; i < MAXDVBAPI; i++) { for (int i = 0; i < MAXDVBAPI; i++) {
if (RecordControls[i]) { if (RecordControls[i]) {
if (RecordControls[i]->Uses(DvbApi)) { if (RecordControls[i]->Uses(DvbApi)) {
isyslog(LOG_INFO, "stopping recording on DVB device %d due to higher priority", DvbApi->CardIndex() + 1); isyslog("stopping recording on DVB device %d due to higher priority", DvbApi->CardIndex() + 1);
RecordControls[i]->Stop(true); RecordControls[i]->Stop(true);
} }
} }

View File

@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # how to reach the author.
# #
# $Id: newplugin 1.1 2002/05/09 15:12:26 kls Exp $ # $Id: newplugin 1.4 2002/05/12 15:02:13 kls Exp $
$PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n"; $PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n";
@ -82,7 +82,8 @@ VDRVERSION = `grep 'define VDRVERSION ' \$(VDRDIR)/config.h | awk '{ print \$\$3
### The name of the distribution archive: ### The name of the distribution archive:
ARCHIVE = vdr-\$(PLUGIN)-\$(VERSION) ARCHIVE = \$(PLUGIN)-\$(VERSION)
PACKAGE = vdr-\$(ARCHIVE)
### Includes and Defines (add further entries here): ### Includes and Defines (add further entries here):
@ -125,9 +126,9 @@ package: clean
\@-rm -rf \$(TMPDIR)/\$(ARCHIVE) \@-rm -rf \$(TMPDIR)/\$(ARCHIVE)
\@mkdir \$(TMPDIR)/\$(ARCHIVE) \@mkdir \$(TMPDIR)/\$(ARCHIVE)
\@cp -a * \$(TMPDIR)/\$(ARCHIVE) \@cp -a * \$(TMPDIR)/\$(ARCHIVE)
\@tar czf \$(ARCHIVE).tgz -C \$(TMPDIR) \$(ARCHIVE) \@tar czf \$(PACKAGE).tgz -C \$(TMPDIR) \$(ARCHIVE)
\@-rm -rf \$(TMPDIR)/\$(ARCHIVE) \@-rm -rf \$(TMPDIR)/\$(ARCHIVE)
\@echo Distribution archive created as \$(ARCHIVE).tgz \@echo Distribution package created as \$(PACKAGE).tgz
clean: clean:
\@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~ \@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~
@ -158,7 +159,8 @@ public:
virtual const char *Description(void) { return DESCRIPTION; } virtual const char *Description(void) { return DESCRIPTION; }
virtual const char *CommandLineHelp(void); virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]); virtual bool ProcessArgs(int argc, char *argv[]);
virtual void Start(void); virtual bool Start(void);
virtual void Housekeeping(void);
virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; } virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; }
virtual cOsdMenu *MainMenuAction(void); virtual cOsdMenu *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void); virtual cMenuSetupPage *SetupMenu(void);
@ -189,9 +191,15 @@ bool cPlugin${PLUGIN_CLASS}::ProcessArgs(int argc, char *argv[])
return true; return true;
} }
void cPlugin${PLUGIN_CLASS}::Start(void) bool cPlugin${PLUGIN_CLASS}::Start(void)
{ {
// Start any background activities the plugin shall perform. // Start any background activities the plugin shall perform.
return true;
}
void cPlugin${PLUGIN_CLASS}::Housekeeping(void)
{
// Perform any cleanup or other regular tasks.
} }
cOsdMenu *cPlugin${PLUGIN_CLASS}::MainMenuAction(void) cOsdMenu *cPlugin${PLUGIN_CLASS}::MainMenuAction(void)

13
osd.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osd.c 1.24 2002/05/01 11:53:24 kls Exp $ * $Id: osd.c 1.25 2002/05/12 11:38:39 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -161,9 +161,16 @@ void cOsdMenu::Del(int Index)
first--; first--;
} }
void cOsdMenu::Add(cOsdItem *Item, bool Current) void cOsdMenu::Add(cOsdItem *Item, bool Current, cOsdItem *After)
{ {
cList<cOsdItem>::Add(Item); cList<cOsdItem>::Add(Item, After);
if (Current)
current = Item->Index();
}
void cOsdMenu::Ins(cOsdItem *Item, bool Current, cOsdItem *Before)
{
cList<cOsdItem>::Ins(Item, Before);
if (Current) if (Current)
current = Item->Index(); current = Item->Index();
} }

5
osd.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osd.h 1.28 2002/05/01 11:17:42 kls Exp $ * $Id: osd.h 1.29 2002/05/12 11:19:22 kls Exp $
*/ */
#ifndef __OSD_H #ifndef __OSD_H
@ -116,7 +116,8 @@ public:
cOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0); cOsdMenu(const char *Title, int c0 = 0, int c1 = 0, int c2 = 0, int c3 = 0, int c4 = 0);
virtual ~cOsdMenu(); virtual ~cOsdMenu();
int Current(void) { return current; } int Current(void) { return current; }
void Add(cOsdItem *Item, bool Current = false); void Add(cOsdItem *Item, bool Current = false, cOsdItem *After = NULL);
void Ins(cOsdItem *Item, bool Current = false, cOsdItem *Before = NULL);
void Display(void); void Display(void);
virtual eOSState ProcessKey(eKeys Key); virtual eOSState ProcessKey(eKeys Key);
}; };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: osdbase.c 1.1 2002/05/10 14:55:53 kls Exp $ * $Id: osdbase.c 1.2 2002/05/13 16:30:59 kls Exp $
*/ */
#include "osdbase.h" #include "osdbase.h"
@ -49,7 +49,7 @@ int cPalette::Index(eDvbColor Color)
return i; return i;
} }
} }
esyslog(LOG_ERR, "ERROR: too many different colors used in palette"); esyslog("ERROR: too many different colors used in palette");
full = true; full = true;
} }
return 0; return 0;
@ -105,10 +105,10 @@ cBitmap::cBitmap(int Width, int Height, int Bpp, bool ClearWithBackground)
SetFont(fontOsd); SetFont(fontOsd);
} }
else else
esyslog(LOG_ERR, "ERROR: can't allocate bitmap!"); esyslog("ERROR: can't allocate bitmap!");
} }
else else
esyslog(LOG_ERR, "ERROR: illegal bitmap parameters (%d, %d)!", width, height); esyslog("ERROR: illegal bitmap parameters (%d, %d)!", width, height);
} }
cBitmap::~cBitmap() cBitmap::~cBitmap()
@ -337,7 +337,7 @@ tWindowHandle cOsd::Create(int x, int y, int w, int h, int Bpp, bool ClearWithBa
if (x >= 0 && y >= 0 && w > 0 && h > 0 && (Bpp == 1 || Bpp == 2 || Bpp == 4 || Bpp == 8)) { if (x >= 0 && y >= 0 && w > 0 && h > 0 && (Bpp == 1 || Bpp == 2 || Bpp == 4 || Bpp == 8)) {
if ((w & 0x03) != 0) { if ((w & 0x03) != 0) {
w += 4 - (w & 0x03); w += 4 - (w & 0x03);
esyslog(LOG_ERR, "ERROR: OSD window width must be a multiple of 4 - increasing to %d", w); esyslog("ERROR: OSD window width must be a multiple of 4 - increasing to %d", w);
} }
cWindow *win = new cWindow(numWindows, x, y, w, h, Bpp, ClearWithBackground, Tiled); cWindow *win = new cWindow(numWindows, x, y, w, h, Bpp, ClearWithBackground, Tiled);
if (OpenWindow(win)) { if (OpenWindow(win)) {
@ -349,10 +349,10 @@ tWindowHandle cOsd::Create(int x, int y, int w, int h, int Bpp, bool ClearWithBa
delete win; delete win;
} }
else else
esyslog(LOG_ERR, "ERROR: illegal OSD parameters"); esyslog("ERROR: illegal OSD parameters");
} }
else else
esyslog(LOG_ERR, "ERROR: too many OSD windows"); esyslog("ERROR: too many OSD windows");
return -1; return -1;
} }
@ -456,7 +456,7 @@ void cOsd::Relocate(tWindowHandle Window, int x, int y, int NewWidth, int NewHei
if (NewWidth > 0 && NewHeight > 0) { if (NewWidth > 0 && NewHeight > 0) {
if ((NewWidth & 0x03) != 0) { if ((NewWidth & 0x03) != 0) {
NewWidth += 4 - (NewWidth & 0x03); NewWidth += 4 - (NewWidth & 0x03);
esyslog(LOG_ERR, "ERROR: OSD window width must be a multiple of 4 - increasing to %d", NewWidth); esyslog("ERROR: OSD window width must be a multiple of 4 - increasing to %d", NewWidth);
} }
CloseWindow(w); CloseWindow(w);
cWindow *NewWindow = new cWindow(w->Handle(), x, y, NewWidth, NewHeight, w->Bpp(), w->ClearWithBackground(), w->Tiled()); cWindow *NewWindow = new cWindow(w->Handle(), x, y, NewWidth, NewHeight, w->Bpp(), w->ClearWithBackground(), w->Tiled());

View File

@ -4,22 +4,26 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: plugin.c 1.1 2002/05/09 16:26:56 kls Exp $ * $Id: plugin.c 1.5 2002/05/13 16:31:09 kls Exp $
*/ */
#include "plugin.h" #include "plugin.h"
#include <ctype.h> #include <ctype.h>
#include <dirent.h> #include <dirent.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <time.h>
#include "config.h" #include "config.h"
#define LIBVDR_PREFIX "libvdr-" #define LIBVDR_PREFIX "libvdr-"
#define SO_INDICATOR ".so." #define SO_INDICATOR ".so."
#define MAXPLUGINARGS 1024 #define MAXPLUGINARGS 1024
#define HOUSEKEEPINGDELTA 10 // seconds
// --- cPlugin --------------------------------------------------------------- // --- cPlugin ---------------------------------------------------------------
char *cPlugin::configDirectory = NULL;
cPlugin::cPlugin(void) cPlugin::cPlugin(void)
{ {
name = NULL; name = NULL;
@ -45,7 +49,12 @@ bool cPlugin::ProcessArgs(int argc, char *argv[])
return true; return true;
} }
void cPlugin::Start(void) bool cPlugin::Start(void)
{
return true;
}
void cPlugin::Housekeeping(void)
{ {
} }
@ -84,6 +93,19 @@ void cPlugin::RegisterI18n(const tI18nPhrase * const Phrases)
I18nRegister(Phrases, Name()); I18nRegister(Phrases, Name());
} }
void cPlugin::SetConfigDirectory(const char *Dir)
{
configDirectory = strdup(Dir);
}
const char *cPlugin::ConfigDirectory(const char *PluginName)
{
static char *buffer = NULL;
delete buffer;
asprintf(&buffer, "%s/plugins%s%s", configDirectory, PluginName ? "/" : "", PluginName ? PluginName : "");
return MakeDirs(buffer, true) ? buffer : NULL;
}
// --- cDll ------------------------------------------------------------------ // --- cDll ------------------------------------------------------------------
cDll::cDll(const char *FileName, const char *Args) cDll::cDll(const char *FileName, const char *Args)
@ -117,7 +139,7 @@ static char *SkipQuote(char *s)
strcpy(s, s + 1); strcpy(s, s + 1);
return s; return s;
} }
esyslog(LOG_ERR, "ERROR: missing closing %c", c); esyslog("ERROR: missing closing %c", c);
fprintf(stderr, "vdr: missing closing %c\n", c); fprintf(stderr, "vdr: missing closing %c\n", c);
return NULL; return NULL;
} }
@ -125,9 +147,9 @@ static char *SkipQuote(char *s)
bool cDll::Load(bool Log) bool cDll::Load(bool Log)
{ {
if (Log) if (Log)
isyslog(LOG_INFO, "loading plugin: %s", fileName); isyslog("loading plugin: %s", fileName);
if (handle) { if (handle) {
esyslog(LOG_ERR, "attempt to load plugin '%s' twice!", fileName); esyslog("attempt to load plugin '%s' twice!", fileName);
return false; return false;
} }
handle = dlopen(fileName, RTLD_NOW); handle = dlopen(fileName, RTLD_NOW);
@ -153,7 +175,7 @@ bool cDll::Load(bool Log)
if (*p) if (*p)
p++; p++;
else { else {
esyslog(LOG_ERR, "ERROR: missing character after \\"); esyslog("ERROR: missing character after \\");
fprintf(stderr, "vdr: missing character after \\\n"); fprintf(stderr, "vdr: missing character after \\\n");
return false; return false;
} }
@ -169,7 +191,7 @@ bool cDll::Load(bool Log)
if (argc < MAXPLUGINARGS - 1) if (argc < MAXPLUGINARGS - 1)
argv[argc++] = q; argv[argc++] = q;
else { else {
esyslog(LOG_ERR, "ERROR: plugin argument list too long"); esyslog("ERROR: plugin argument list too long");
fprintf(stderr, "vdr: plugin argument list too long\n"); fprintf(stderr, "vdr: plugin argument list too long\n");
return false; return false;
} }
@ -188,7 +210,7 @@ bool cDll::Load(bool Log)
} }
} }
else { else {
esyslog(LOG_ERR, "ERROR: %s", error); esyslog("ERROR: %s", error);
fprintf(stderr, "vdr: %s\n", error); fprintf(stderr, "vdr: %s\n", error);
} }
return !error && plugin; return !error && plugin;
@ -201,6 +223,8 @@ cPluginManager *cPluginManager::pluginManager = NULL;
cPluginManager::cPluginManager(const char *Directory) cPluginManager::cPluginManager(const char *Directory)
{ {
directory = NULL; directory = NULL;
lastHousekeeping = time(NULL);
nextHousekeeping = -1;
if (pluginManager) { if (pluginManager) {
fprintf(stderr, "vdr: attempt to create more than one plugin manager - exiting!\n"); fprintf(stderr, "vdr: attempt to create more than one plugin manager - exiting!\n");
exit(2); exit(2);
@ -268,18 +292,36 @@ bool cPluginManager::LoadPlugins(bool Log)
return true; return true;
} }
void cPluginManager::StartPlugins(void) bool cPluginManager::StartPlugins(void)
{ {
for (cDll *dll = dlls.First(); dll; dll = dlls.Next(dll)) { for (cDll *dll = dlls.First(); dll; dll = dlls.Next(dll)) {
cPlugin *p = dll->Plugin(); cPlugin *p = dll->Plugin();
if (p) { if (p) {
int Language = Setup.OSDLanguage; int Language = Setup.OSDLanguage;
Setup.OSDLanguage = 0; // the i18n texts are only available _after_ Start() Setup.OSDLanguage = 0; // the i18n texts are only available _after_ Start()
isyslog(LOG_INFO, "starting plugin: %s (%s): %s", p->Name(), p->Version(), p->Description()); isyslog("starting plugin: %s (%s): %s", p->Name(), p->Version(), p->Description());
Setup.OSDLanguage = Language; Setup.OSDLanguage = Language;
dll->Plugin()->Start(); if (!p->Start())
return false;
} }
} }
return true;
}
void cPluginManager::Housekeeping(void)
{
if (time(NULL) - lastHousekeeping > HOUSEKEEPINGDELTA) {
if (++nextHousekeeping >= dlls.Count())
nextHousekeeping = 0;
cDll *dll = dlls.Get(nextHousekeeping);
if (dll) {
cPlugin *p = dll->Plugin();
if (p) {
p->Housekeeping();
}
}
lastHousekeeping = time(NULL);
}
} }
bool cPluginManager::HasPlugins(void) bool cPluginManager::HasPlugins(void)
@ -312,7 +354,7 @@ void cPluginManager::Shutdown(bool Log)
if (Log) { if (Log) {
cPlugin *p = dll->Plugin(); cPlugin *p = dll->Plugin();
if (p) if (p)
isyslog(LOG_INFO, "stopping plugin: %s", p->Name()); isyslog("stopping plugin: %s", p->Name());
} }
dlls.Del(dll); dlls.Del(dll);
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: plugin.h 1.1 2002/05/09 10:16:09 kls Exp $ * $Id: plugin.h 1.4 2002/05/13 15:32:14 kls Exp $
*/ */
#ifndef __PLUGIN_H #ifndef __PLUGIN_H
@ -20,6 +20,7 @@
class cPlugin { class cPlugin {
friend class cDll; friend class cDll;
private: private:
static char *configDirectory;
const char *name; const char *name;
void SetName(const char *s); void SetName(const char *s);
public: public:
@ -32,7 +33,8 @@ public:
virtual const char *CommandLineHelp(void); virtual const char *CommandLineHelp(void);
virtual bool ProcessArgs(int argc, char *argv[]); virtual bool ProcessArgs(int argc, char *argv[]);
virtual void Start(void); virtual bool Start(void);
virtual void Housekeeping(void);
virtual const char *MainMenuEntry(void); virtual const char *MainMenuEntry(void);
virtual cOsdMenu *MainMenuAction(void); virtual cOsdMenu *MainMenuAction(void);
@ -43,6 +45,9 @@ public:
void SetupStore(const char *Name, int Value); void SetupStore(const char *Name, int Value);
void RegisterI18n(const tI18nPhrase * const Phrases); void RegisterI18n(const tI18nPhrase * const Phrases);
static void SetConfigDirectory(const char *Dir);
static const char *ConfigDirectory(const char *PluginName = NULL);
}; };
class cDll : public cListObject { class cDll : public cListObject {
@ -64,6 +69,8 @@ class cPluginManager {
private: private:
static cPluginManager *pluginManager; static cPluginManager *pluginManager;
char *directory; char *directory;
time_t lastHousekeeping;
int nextHousekeeping;
cDlls dlls; cDlls dlls;
public: public:
cPluginManager(const char *Directory); cPluginManager(const char *Directory);
@ -71,7 +78,8 @@ public:
void SetDirectory(const char *Directory); void SetDirectory(const char *Directory);
void AddPlugin(const char *Args); void AddPlugin(const char *Args);
bool LoadPlugins(bool Log = false); bool LoadPlugins(bool Log = false);
void StartPlugins(void); bool StartPlugins(void);
void Housekeeping(void);
static bool HasPlugins(void); static bool HasPlugins(void);
static cPlugin *GetPlugin(int Index); static cPlugin *GetPlugin(int Index);
static cPlugin *GetPlugin(const char *Name); static cPlugin *GetPlugin(const char *Name);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.61 2002/04/21 14:02:55 kls Exp $ * $Id: recording.c 1.62 2002/05/13 16:31:21 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -86,7 +86,7 @@ void AssertFreeDiskSpace(int Priority)
if (!LockFile.Lock()) if (!LockFile.Lock())
return; return;
// Remove the oldest file that has been "deleted": // Remove the oldest file that has been "deleted":
isyslog(LOG_INFO, "low disk space while recording, trying to remove a deleted recording..."); isyslog("low disk space while recording, trying to remove a deleted recording...");
cRecordings Recordings; cRecordings Recordings;
if (Recordings.Load(true)) { if (Recordings.Load(true)) {
cRecording *r = Recordings.First(); cRecording *r = Recordings.First();
@ -102,7 +102,7 @@ void AssertFreeDiskSpace(int Priority)
} }
} }
// No "deleted" files to remove, so let's see if we can delete a recording: // No "deleted" files to remove, so let's see if we can delete a recording:
isyslog(LOG_INFO, "...no deleted recording found, trying to delete an old recording..."); isyslog("...no deleted recording found, trying to delete an old recording...");
if (Recordings.Load(false)) { if (Recordings.Load(false)) {
cRecording *r = Recordings.First(); cRecording *r = Recordings.First();
cRecording *r0 = NULL; cRecording *r0 = NULL;
@ -124,7 +124,7 @@ void AssertFreeDiskSpace(int Priority)
return; return;
} }
// Unable to free disk space, but there's nothing we can do about that... // Unable to free disk space, but there's nothing we can do about that...
isyslog(LOG_INFO, "...no old recording found, giving up"); isyslog("...no old recording found, giving up");
Interface->Confirm(tr("Low disk space!"), 30); Interface->Confirm(tr("Low disk space!"), 30);
} }
LastFreeDiskCheck = time(NULL); LastFreeDiskCheck = time(NULL);
@ -141,7 +141,7 @@ cResumeFile::cResumeFile(const char *FileName)
strcat(fileName, RESUMEFILESUFFIX); strcat(fileName, RESUMEFILESUFFIX);
} }
else else
esyslog(LOG_ERR, "ERROR: can't allocate memory for resume file name"); esyslog("ERROR: can't allocate memory for resume file name");
} }
cResumeFile::~cResumeFile() cResumeFile::~cResumeFile()
@ -368,7 +368,7 @@ cRecording::cRecording(const char *FileName)
if (rbytes >= 0) { if (rbytes >= 0) {
summary[rbytes] = 0; summary[rbytes] = 0;
if (rbytes != size) if (rbytes != size)
esyslog(LOG_ERR, "%s: expected %d bytes but read %d", SummaryFileName, size, rbytes); esyslog("%s: expected %d bytes but read %d", SummaryFileName, size, rbytes);
} }
else { else {
LOG_ERROR_STR(SummaryFileName); LOG_ERROR_STR(SummaryFileName);
@ -378,7 +378,7 @@ cRecording::cRecording(const char *FileName)
} }
else else
esyslog(LOG_ERR, "can't allocate %d byte of memory for summary file '%s'", size + 1, SummaryFileName); esyslog("can't allocate %d byte of memory for summary file '%s'", size + 1, SummaryFileName);
close(f); close(f);
} }
else else
@ -556,10 +556,10 @@ bool cRecording::Delete(void)
strncpy(ext, DELEXT, strlen(ext)); strncpy(ext, DELEXT, strlen(ext));
if (access(NewName, F_OK) == 0) { if (access(NewName, F_OK) == 0) {
// the new name already exists, so let's remove that one first: // the new name already exists, so let's remove that one first:
isyslog(LOG_INFO, "removing recording %s", NewName); isyslog("removing recording %s", NewName);
RemoveVideoFile(NewName); RemoveVideoFile(NewName);
} }
isyslog(LOG_INFO, "deleting recording %s", FileName()); isyslog("deleting recording %s", FileName());
result = RenameVideoFile(FileName(), NewName); result = RenameVideoFile(FileName(), NewName);
} }
delete NewName; delete NewName;
@ -570,10 +570,10 @@ bool cRecording::Remove(void)
{ {
// let's do a final safety check here: // let's do a final safety check here:
if (!endswith(FileName(), DELEXT)) { if (!endswith(FileName(), DELEXT)) {
esyslog(LOG_ERR, "attempt to remove recording %s", FileName()); esyslog("attempt to remove recording %s", FileName());
return false; return false;
} }
isyslog(LOG_INFO, "removing recording %s", FileName()); isyslog("removing recording %s", FileName());
return RemoveVideoFile(FileName()); return RemoveVideoFile(FileName());
} }
@ -727,7 +727,7 @@ void cRecordingUserCommand::InvokeCommand(const char *State, const char *Recordi
if (command) { if (command) {
char *cmd; char *cmd;
asprintf(&cmd, "%s %s \"%s\"", command, State, strescape(RecordingFileName, "\"$")); asprintf(&cmd, "%s %s \"%s\"", command, State, strescape(RecordingFileName, "\"$"));
isyslog(LOG_INFO, "executing '%s'", cmd); isyslog("executing '%s'", cmd);
SystemExec(cmd); SystemExec(cmd);
delete cmd; delete cmd;
} }

View File

@ -6,7 +6,7 @@
* *
* Ported to LIRC by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16. * Ported to LIRC by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16.
* *
* $Id: remote.c 1.25 2001/09/30 11:39:49 kls Exp $ * $Id: remote.c 1.26 2002/05/13 16:31:27 kls Exp $
*/ */
#include "remote.h" #include "remote.h"
@ -130,7 +130,7 @@ void cRcIoRCU::Action(void)
} buffer; } buffer;
#pragma pack() #pragma pack()
dsyslog(LOG_INFO, "RCU remote control thread started (pid=%d)", getpid()); dsyslog("RCU remote control thread started (pid=%d)", getpid());
int FirstTime = 0; int FirstTime = 0;
unsigned int LastCommand = 0; unsigned int LastCommand = 0;
@ -425,7 +425,7 @@ cRcIoLIRC::~cRcIoLIRC()
void cRcIoLIRC::Action(void) void cRcIoLIRC::Action(void)
{ {
dsyslog(LOG_INFO, "LIRC remote control thread started (pid=%d)", getpid()); dsyslog("LIRC remote control thread started (pid=%d)", getpid());
int FirstTime = 0; int FirstTime = 0;
int LastTime = 0; int LastTime = 0;

14
remux.c
View File

@ -8,7 +8,7 @@
* the Linux DVB driver's 'tuxplayer' example and were rewritten to suit * the Linux DVB driver's 'tuxplayer' example and were rewritten to suit
* VDR's needs. * VDR's needs.
* *
* $Id: remux.c 1.8 2002/02/03 16:20:37 kls Exp $ * $Id: remux.c 1.9 2002/05/13 16:31:38 kls Exp $
*/ */
/* The calling interface of the 'cRemux::Process()' function is defined /* The calling interface of the 'cRemux::Process()' function is defined
@ -154,7 +154,7 @@ cTS2PES::cTS2PES(uint8_t *ResultBuffer, int *ResultCount, int Size, uint8_t Audi
audioCid = AudioCid; audioCid = AudioCid;
if (!(buf = new uint8_t[size])) if (!(buf = new uint8_t[size]))
esyslog(LOG_ERR, "Not enough memory for ts_transform"); esyslog("Not enough memory for ts_transform");
reset_ipack(); reset_ipack();
} }
@ -172,7 +172,7 @@ void cTS2PES::Clear(void)
void cTS2PES::store(uint8_t *Data, int Count) void cTS2PES::store(uint8_t *Data, int Count)
{ {
if (*resultCount + Count > RESULTBUFFERSIZE) { if (*resultCount + Count > RESULTBUFFERSIZE) {
esyslog(LOG_ERR, "ERROR: result buffer overflow (%d + %d > %d)", *resultCount, Count, RESULTBUFFERSIZE); esyslog("ERROR: result buffer overflow (%d + %d > %d)", *resultCount, Count, RESULTBUFFERSIZE);
Count = RESULTBUFFERSIZE - *resultCount; Count = RESULTBUFFERSIZE - *resultCount;
} }
memcpy(resultBuffer + *resultCount, Data, Count); memcpy(resultBuffer + *resultCount, Data, Count);
@ -309,7 +309,7 @@ void cTS2PES::instant_repack(const uint8_t *Buf, int Count)
if ((flag1 & 0xC0) == 0x80 ) if ((flag1 & 0xC0) == 0x80 )
mpeg = 2; mpeg = 2;
else { else {
esyslog(LOG_INFO, "ERROR: can't record MPEG1!"); esyslog("ERROR: can't record MPEG1!");
hlength = 0; hlength = 0;
which = 0; which = 0;
mpeg = 1; mpeg = 1;
@ -525,7 +525,7 @@ XXX*/
used++; used++;
} }
if (used) if (used)
esyslog(LOG_ERR, "ERROR: skipped %d byte to sync on TS packet", used); esyslog("ERROR: skipped %d byte to sync on TS packet", used);
// Convert incoming TS data into multiplexed PES: // Convert incoming TS data into multiplexed PES:
@ -570,7 +570,7 @@ XXX*/
if (!synced && skipped >= 0) { if (!synced && skipped >= 0) {
if (skipped > MAXNONUSEFULDATA) { if (skipped > MAXNONUSEFULDATA) {
esyslog(LOG_ERR, "ERROR: no useful data seen within %d byte of video stream", skipped); esyslog("ERROR: no useful data seen within %d byte of video stream", skipped);
skipped = -1; skipped = -1;
if (exitOnFailure) if (exitOnFailure)
cThread::EmergencyExit(true); cThread::EmergencyExit(true);
@ -595,7 +595,7 @@ XXX*/
return NULL; // no useful data found, wait for more return NULL; // no useful data found, wait for more
if (pt != NO_PICTURE) { if (pt != NO_PICTURE) {
if (pt < I_FRAME || B_FRAME < pt) if (pt < I_FRAME || B_FRAME < pt)
esyslog(LOG_ERR, "ERROR: unknown picture type '%d'", pt); esyslog("ERROR: unknown picture type '%d'", pt);
else if (!synced) { else if (!synced) {
if (pt == I_FRAME) { if (pt == I_FRAME) {
resultDelivered = i; // will drop everything before this position resultDelivered = i; // will drop everything before this position

View File

@ -7,7 +7,7 @@
* Parts of this file were inspired by the 'ringbuffy.c' from the * Parts of this file were inspired by the 'ringbuffy.c' from the
* LinuxDVB driver (see linuxtv.org). * LinuxDVB driver (see linuxtv.org).
* *
* $Id: ringbuffer.c 1.6 2002/04/18 15:46:36 kls Exp $ * $Id: ringbuffer.c 1.7 2002/05/13 16:31:46 kls Exp $
*/ */
#include "ringbuffer.h" #include "ringbuffer.h"
@ -52,7 +52,7 @@ cRingBuffer::~cRingBuffer()
delete inputThread; delete inputThread;
delete outputThread; delete outputThread;
if (statistics) if (statistics)
dsyslog(LOG_INFO, "buffer stats: %d (%d%%) used", maxFill, maxFill * 100 / (size - 1)); dsyslog("buffer stats: %d (%d%%) used", maxFill, maxFill * 100 / (size - 1));
} }
void cRingBuffer::WaitForPut(void) void cRingBuffer::WaitForPut(void)
@ -121,11 +121,11 @@ cRingBufferLinear::cRingBufferLinear(int Size, bool Statistics)
if (Size > 1) { // 'Size - 1' must not be 0! if (Size > 1) { // 'Size - 1' must not be 0!
buffer = new uchar[Size]; buffer = new uchar[Size];
if (!buffer) if (!buffer)
esyslog(LOG_ERR, "ERROR: can't allocate ring buffer (size=%d)", Size); esyslog("ERROR: can't allocate ring buffer (size=%d)", Size);
Clear(); Clear();
} }
else else
esyslog(LOG_ERR, "ERROR: illegal size for ring buffer (%d)", Size); esyslog("ERROR: illegal size for ring buffer (%d)", Size);
} }
cRingBufferLinear::~cRingBufferLinear() cRingBufferLinear::~cRingBufferLinear()
@ -163,7 +163,7 @@ int cRingBufferLinear::Put(const uchar *Data, int Count)
maxFill = fill; maxFill = fill;
int percent = maxFill * 100 / (Size() - 1); int percent = maxFill * 100 / (Size() - 1);
if (percent > 75) if (percent > 75)
dsyslog(LOG_INFO, "buffer usage: %d%%", percent); dsyslog("buffer usage: %d%%", percent);
} }
} }
if (free > 0) { if (free > 0) {
@ -228,7 +228,7 @@ cFrame::cFrame(const uchar *Data, int Count, eFrameType Type, int Index)
if (data) if (data)
memcpy(data, Data, count); memcpy(data, Data, count);
else else
esyslog(LOG_ERR, "ERROR: can't allocate frame buffer (count=%d)", count); esyslog("ERROR: can't allocate frame buffer (count=%d)", count);
next = NULL; next = NULL;
} }
@ -314,7 +314,7 @@ void cRingBufferFrame::Drop(const cFrame *Frame)
} }
} }
else else
esyslog(LOG_ERR, "ERROR: attempt to drop wrong frame from ring buffer!"); esyslog("ERROR: attempt to drop wrong frame from ring buffer!");
} }
Unlock(); Unlock();
EnablePut(); EnablePut();

32
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.36 2002/05/10 15:05:57 kls Exp $ * $Id: svdrp.c 1.37 2002/05/13 16:32:05 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -109,7 +109,7 @@ int cSocket::Accept(void)
close(newsock); close(newsock);
newsock = -1; newsock = -1;
} }
isyslog(LOG_INFO, "connect from %s, port %hd - %s", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port), accepted ? "accepted" : "DENIED"); isyslog("connect from %s, port %hd - %s", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port), accepted ? "accepted" : "DENIED");
} }
else if (errno != EINTR && errno != EAGAIN) else if (errno != EINTR && errno != EAGAIN)
LOG_ERROR; LOG_ERROR;
@ -314,7 +314,7 @@ cSVDRP::cSVDRP(int Port)
numChars = 0; numChars = 0;
message = NULL; message = NULL;
lastActivity = 0; lastActivity = 0;
isyslog(LOG_INFO, "SVDRP listening on port %d", Port); isyslog("SVDRP listening on port %d", Port);
} }
cSVDRP::~cSVDRP() cSVDRP::~cSVDRP()
@ -330,7 +330,7 @@ void cSVDRP::Close(bool Timeout)
char buffer[BUFSIZ]; char buffer[BUFSIZ];
gethostname(buffer, sizeof(buffer)); gethostname(buffer, sizeof(buffer));
Reply(221, "%s closing connection%s", buffer, Timeout ? " (timeout)" : ""); Reply(221, "%s closing connection%s", buffer, Timeout ? " (timeout)" : "");
isyslog(LOG_INFO, "closing SVDRP connection"); //TODO store IP#??? isyslog("closing SVDRP connection"); //TODO store IP#???
file.Close(); file.Close();
DELETENULL(PUTEhandler); DELETENULL(PUTEhandler);
} }
@ -375,7 +375,7 @@ void cSVDRP::Reply(int Code, const char *fmt, ...)
} }
else { else {
Reply(451, "Zero return code - looks like a programming error!"); Reply(451, "Zero return code - looks like a programming error!");
esyslog(LOG_ERR, "SVDRP: zero return code!"); esyslog("SVDRP: zero return code!");
} }
} }
} }
@ -473,7 +473,7 @@ void cSVDRP::CmdDELT(const char *Option)
if (!timer->recording) { if (!timer->recording) {
Timers.Del(timer); Timers.Del(timer);
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %s deleted", Option); isyslog("timer %s deleted", Option);
Reply(250, "Timer \"%s\" deleted", Option); Reply(250, "Timer \"%s\" deleted", Option);
} }
else else
@ -738,7 +738,7 @@ void cSVDRP::CmdMESG(const char *Option)
if (*Option) { if (*Option) {
delete message; delete message;
message = strdup(Option); message = strdup(Option);
isyslog(LOG_INFO, "SVDRP message: '%s'", message); isyslog("SVDRP message: '%s'", message);
Reply(250, "Message stored"); Reply(250, "Message stored");
} }
else if (message) else if (message)
@ -763,7 +763,7 @@ void cSVDRP::CmdMODC(const char *Option)
} }
*channel = c; *channel = c;
Channels.Save(); Channels.Save();
isyslog(LOG_INFO, "channel %d modified", channel->number); isyslog("channel %d modified", channel->number);
Reply(250, "%d %s", channel->number, channel->ToText()); Reply(250, "%d %s", channel->number, channel->ToText());
} }
else else
@ -796,7 +796,7 @@ void cSVDRP::CmdMODT(const char *Option)
} }
*timer = t; *timer = t;
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive"); isyslog("timer %d modified (%s)", timer->Index() + 1, timer->active ? "active" : "inactive");
Reply(250, "%d %s", timer->Index() + 1, timer->ToText()); Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
} }
else else
@ -829,7 +829,7 @@ void cSVDRP::CmdNEWC(const char *Option)
Channels.Add(channel); Channels.Add(channel);
Channels.ReNumber(); Channels.ReNumber();
Channels.Save(); Channels.Save();
isyslog(LOG_INFO, "channel %d added", channel->number); isyslog("channel %d added", channel->number);
Reply(250, "%d %s", channel->number, channel->ToText()); Reply(250, "%d %s", channel->number, channel->ToText());
} }
else else
@ -848,7 +848,7 @@ void cSVDRP::CmdNEWT(const char *Option)
if (!t) { if (!t) {
Timers.Add(timer); Timers.Add(timer);
Timers.Save(); Timers.Save();
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1); isyslog("timer %d added", timer->Index() + 1);
Reply(250, "%d %s", timer->Index() + 1, timer->ToText()); Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
return; return;
} }
@ -904,11 +904,11 @@ void cSVDRP::CmdUPDT(const char *Option)
t->Parse(Option); t->Parse(Option);
delete timer; delete timer;
timer = t; timer = t;
isyslog(LOG_INFO, "timer %d updated", timer->Index() + 1); isyslog("timer %d updated", timer->Index() + 1);
} }
else { else {
Timers.Add(timer); Timers.Add(timer);
isyslog(LOG_INFO, "timer %d added", timer->Index() + 1); isyslog("timer %d added", timer->Index() + 1);
} }
Timers.Save(); Timers.Save();
Reply(250, "%d %s", timer->Index() + 1, timer->ToText()); Reply(250, "%d %s", timer->Index() + 1, timer->ToText());
@ -1038,18 +1038,18 @@ void cSVDRP::Process(void)
} }
else { else {
Reply(501, "Command line too long"); Reply(501, "Command line too long");
esyslog(LOG_ERR, "SVDRP: command line too long: '%s'", cmdLine); esyslog("SVDRP: command line too long: '%s'", cmdLine);
numChars = 0; numChars = 0;
} }
lastActivity = time(NULL); lastActivity = time(NULL);
} }
else if (r <= 0) { else if (r <= 0) {
isyslog(LOG_INFO, "lost connection to SVDRP client"); isyslog("lost connection to SVDRP client");
Close(); Close();
} }
} }
if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) { if (Setup.SVDRPTimeout && time(NULL) - lastActivity > Setup.SVDRPTimeout) {
isyslog(LOG_INFO, "timeout on SVDRP connection"); isyslog("timeout on SVDRP connection");
Close(true); Close(true);
} }
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: thread.c 1.19 2002/03/09 12:05:44 kls Exp $ * $Id: thread.c 1.20 2002/05/13 16:32:09 kls Exp $
*/ */
#include "thread.h" #include "thread.h"
@ -153,7 +153,7 @@ void cThread::Cancel(int WaitSeconds)
return; return;
usleep(10000); usleep(10000);
} }
esyslog(LOG_ERR, "ERROR: thread %d won't end (waited %d seconds) - cancelling it...", threadPid, WaitSeconds); esyslog("ERROR: thread %d won't end (waited %d seconds) - cancelling it...", threadPid, WaitSeconds);
} }
pthread_cancel(thread); pthread_cancel(thread);
} }
@ -175,18 +175,18 @@ void cThread::RaisePanic(void)
} }
lastPanic = time(NULL); lastPanic = time(NULL);
if (panicLevel > MAXPANICLEVEL) { if (panicLevel > MAXPANICLEVEL) {
esyslog(LOG_ERR, "ERROR: max. panic level exceeded"); esyslog("ERROR: max. panic level exceeded");
EmergencyExit(true); EmergencyExit(true);
} }
else else
dsyslog(LOG_INFO, "panic level: %d", panicLevel); dsyslog("panic level: %d", panicLevel);
} }
bool cThread::EmergencyExit(bool Request) bool cThread::EmergencyExit(bool Request)
{ {
if (!Request) if (!Request)
return emergencyExitRequested; return emergencyExitRequested;
esyslog(LOG_ERR, "initiating emergency exit"); esyslog("initiating emergency exit");
return emergencyExitRequested = true; // yes, it's an assignment, not a comparison! return emergencyExitRequested = true; // yes, it's an assignment, not a comparison!
} }

79
tools.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.c 1.63 2002/05/01 16:20:30 kls Exp $ * $Id: tools.c 1.66 2002/05/13 17:56:17 kls Exp $
*/ */
#include "tools.h" #include "tools.h"
@ -25,7 +25,7 @@ ssize_t safe_read(int filedes, void *buffer, size_t size)
for (;;) { for (;;) {
ssize_t p = read(filedes, buffer, size); ssize_t p = read(filedes, buffer, size);
if (p < 0 && errno == EINTR) { if (p < 0 && errno == EINTR) {
dsyslog(LOG_INFO, "EINTR while reading from file handle %d - retrying", filedes); dsyslog("EINTR while reading from file handle %d - retrying", filedes);
continue; continue;
} }
return p; return p;
@ -41,7 +41,7 @@ ssize_t safe_write(int filedes, const void *buffer, size_t size)
p = write(filedes, ptr, size); p = write(filedes, ptr, size);
if (p < 0) { if (p < 0) {
if (errno == EINTR) { if (errno == EINTR) {
dsyslog(LOG_INFO, "EINTR while writing to file handle %d - retrying", filedes); dsyslog("EINTR while writing to file handle %d - retrying", filedes);
continue; continue;
} }
break; break;
@ -77,7 +77,7 @@ char *strcpyrealloc(char *dest, const char *src)
if (dest) if (dest)
strcpy(dest, src); strcpy(dest, src);
else else
esyslog(LOG_ERR, "ERROR: out of memory"); esyslog("ERROR: out of memory");
} }
else { else {
delete dest; delete dest;
@ -269,10 +269,10 @@ bool DirectoryOk(const char *DirName, bool LogErrors)
if (access(DirName, R_OK | W_OK | X_OK) == 0) if (access(DirName, R_OK | W_OK | X_OK) == 0)
return true; return true;
else if (LogErrors) else if (LogErrors)
esyslog(LOG_ERR, "ERROR: can't access %s", DirName); esyslog("ERROR: can't access %s", DirName);
} }
else if (LogErrors) else if (LogErrors)
esyslog(LOG_ERR, "ERROR: %s is not a directory", DirName); esyslog("ERROR: %s is not a directory", DirName);
} }
else if (LogErrors) else if (LogErrors)
LOG_ERROR_STR(DirName); LOG_ERROR_STR(DirName);
@ -291,7 +291,7 @@ bool MakeDirs(const char *FileName, bool IsDirectory)
*p = 0; *p = 0;
struct stat fs; struct stat fs;
if (stat(s, &fs) != 0 || !S_ISDIR(fs.st_mode)) { if (stat(s, &fs) != 0 || !S_ISDIR(fs.st_mode)) {
dsyslog(LOG_INFO, "creating directory %s", s); dsyslog("creating directory %s", s);
if (mkdir(s, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1) { if (mkdir(s, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1) {
LOG_ERROR_STR(s); LOG_ERROR_STR(s);
result = false; result = false;
@ -329,15 +329,15 @@ bool RemoveFileOrDir(const char *FileName, bool FollowSymlinks)
} }
else if (n < size) { else if (n < size) {
l[n] = 0; l[n] = 0;
dsyslog(LOG_INFO, "removing %s", l); dsyslog("removing %s", l);
if (remove(l) < 0) if (remove(l) < 0)
LOG_ERROR_STR(l); LOG_ERROR_STR(l);
} }
else else
esyslog(LOG_ERR, "ERROR: symlink name length (%d) exceeded anticipated buffer size (%d)", n, size); esyslog("ERROR: symlink name length (%d) exceeded anticipated buffer size (%d)", n, size);
delete l; delete l;
} }
dsyslog(LOG_INFO, "removing %s", buffer); dsyslog("removing %s", buffer);
if (remove(buffer) < 0) if (remove(buffer) < 0)
LOG_ERROR_STR(buffer); LOG_ERROR_STR(buffer);
delete buffer; delete buffer;
@ -350,7 +350,7 @@ bool RemoveFileOrDir(const char *FileName, bool FollowSymlinks)
return false; return false;
} }
} }
dsyslog(LOG_INFO, "removing %s", FileName); dsyslog("removing %s", FileName);
if (remove(FileName) < 0) { if (remove(FileName) < 0) {
LOG_ERROR_STR(FileName); LOG_ERROR_STR(FileName);
return false; return false;
@ -392,7 +392,7 @@ bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis)
} }
closedir(d); closedir(d);
if (RemoveThis && empty) { if (RemoveThis && empty) {
dsyslog(LOG_INFO, "removing %s", DirName); dsyslog("removing %s", DirName);
if (remove(DirName) < 0) { if (remove(DirName) < 0) {
LOG_ERROR_STR(DirName); LOG_ERROR_STR(DirName);
return false; return false;
@ -421,7 +421,7 @@ char *ReadLink(const char *FileName)
TargetName = RealName; TargetName = RealName;
} }
else else
esyslog(LOG_ERR, "ERROR: symlink's target name too long: %s", FileName); esyslog("ERROR: symlink's target name too long: %s", FileName);
return TargetName ? strdup(TargetName) : NULL; return TargetName ? strdup(TargetName) : NULL;
} }
@ -446,14 +446,14 @@ bool SpinUpDisk(const char *FileName)
gettimeofday(&tp2, NULL); gettimeofday(&tp2, NULL);
double seconds = (((long long)tp2.tv_sec * 1000000 + tp2.tv_usec) - ((long long)tp1.tv_sec * 1000000 + tp1.tv_usec)) / 1000000.0; double seconds = (((long long)tp2.tv_sec * 1000000 + tp2.tv_usec) - ((long long)tp1.tv_sec * 1000000 + tp1.tv_usec)) / 1000000.0;
if (seconds > 0.5) if (seconds > 0.5)
dsyslog(LOG_INFO, "SpinUpDisk took %.2f seconds\n", seconds); dsyslog("SpinUpDisk took %.2f seconds\n", seconds);
return true; return true;
} }
else else
LOG_ERROR_STR(buf); LOG_ERROR_STR(buf);
} }
} }
esyslog(LOG_ERR, "ERROR: SpinUpDisk failed"); esyslog("ERROR: SpinUpDisk failed");
return false; return false;
} }
@ -501,7 +501,7 @@ bool cFile::Open(const char *FileName, int Flags, mode_t Mode)
{ {
if (!IsOpen()) if (!IsOpen())
return Open(open(FileName, Flags, Mode)); return Open(open(FileName, Flags, Mode));
esyslog(LOG_ERR, "ERROR: attempt to re-open %s", FileName); esyslog("ERROR: attempt to re-open %s", FileName);
return false; return false;
} }
@ -517,15 +517,15 @@ bool cFile::Open(int FileDes)
if (!files[f]) if (!files[f])
files[f] = true; files[f] = true;
else else
esyslog(LOG_ERR, "ERROR: file descriptor %d already in files[]", f); esyslog("ERROR: file descriptor %d already in files[]", f);
return true; return true;
} }
else else
esyslog(LOG_ERR, "ERROR: file descriptor %d is larger than FD_SETSIZE (%d)", f, FD_SETSIZE); esyslog("ERROR: file descriptor %d is larger than FD_SETSIZE (%d)", f, FD_SETSIZE);
} }
} }
else else
esyslog(LOG_ERR, "ERROR: attempt to re-open file descriptor %d", FileDes); esyslog("ERROR: attempt to re-open file descriptor %d", FileDes);
} }
return false; return false;
} }
@ -671,7 +671,7 @@ bool cLockFile::Lock(int WaitSeconds)
struct stat fs; struct stat fs;
if (stat(fileName, &fs) == 0) { if (stat(fileName, &fs) == 0) {
if (time(NULL) - fs.st_mtime > LOCKFILESTALETIME) { if (time(NULL) - fs.st_mtime > LOCKFILESTALETIME) {
esyslog(LOG_ERR, "ERROR: removing stale lock file '%s'", fileName); esyslog("ERROR: removing stale lock file '%s'", fileName);
if (remove(fileName) < 0) { if (remove(fileName) < 0) {
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
break; break;
@ -704,7 +704,7 @@ void cLockFile::Unlock(void)
f = -1; f = -1;
} }
else else
esyslog(LOG_ERR, "ERROR: attempt to unlock %s without holding a lock!", fileName); esyslog("ERROR: attempt to unlock %s without holding a lock!", fileName);
} }
// --- cListObject ----------------------------------------------------------- // --- cListObject -----------------------------------------------------------
@ -724,6 +724,12 @@ void cListObject::Append(cListObject *Object)
Object->prev = this; Object->prev = this;
} }
void cListObject::Insert(cListObject *Object)
{
prev = Object;
Object->next = this;
}
void cListObject::Unlink(void) void cListObject::Unlink(void)
{ {
if (next) if (next)
@ -757,13 +763,34 @@ cListBase::~cListBase()
Clear(); Clear();
} }
void cListBase::Add(cListObject *Object) void cListBase::Add(cListObject *Object, cListObject *After)
{ {
if (lastObject) if (After && After != lastObject) {
lastObject->Append(Object); After->Next()->Insert(Object);
else After->Append(Object);
}
else {
if (lastObject)
lastObject->Append(Object);
else
objects = Object;
lastObject = Object;
}
}
void cListBase::Ins(cListObject *Object, cListObject *Before)
{
if (Before && Before != objects) {
Before->Prev()->Append(Object);
Before->Insert(Object);
}
else {
if (objects)
objects->Insert(Object);
else
lastObject = Object;
objects = Object; objects = Object;
lastObject = Object; }
} }
void cListBase::Del(cListObject *Object) void cListBase::Del(cListObject *Object)

16
tools.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: tools.h 1.43 2002/05/11 08:35:47 kls Exp $ * $Id: tools.h 1.45 2002/05/13 16:21:55 kls Exp $
*/ */
#ifndef __TOOLS_H #ifndef __TOOLS_H
@ -20,12 +20,12 @@
extern int SysLogLevel; extern int SysLogLevel;
#define esyslog(a...) void( (SysLogLevel > 0) ? syslog(a) : void() ) #define esyslog(a...) void( (SysLogLevel > 0) ? syslog(LOG_ERR, a) : void() )
#define isyslog(a...) void( (SysLogLevel > 1) ? syslog(a) : void() ) #define isyslog(a...) void( (SysLogLevel > 1) ? syslog(LOG_INFO, a) : void() )
#define dsyslog(a...) void( (SysLogLevel > 2) ? syslog(a) : void() ) #define dsyslog(a...) void( (SysLogLevel > 2) ? syslog(LOG_DEBUG, a) : void() )
#define LOG_ERROR esyslog(LOG_ERR, "ERROR (%s,%d): %m", __FILE__, __LINE__) #define LOG_ERROR esyslog("ERROR (%s,%d): %m", __FILE__, __LINE__)
#define LOG_ERROR_STR(s) esyslog(LOG_ERR, "ERROR: %s: %m", s) #define LOG_ERROR_STR(s) esyslog("ERROR: %s: %m", s)
#define SECSINDAY 86400 #define SECSINDAY 86400
@ -120,6 +120,7 @@ public:
virtual ~cListObject(); virtual ~cListObject();
virtual bool operator< (const cListObject &ListObject) { return false; } virtual bool operator< (const cListObject &ListObject) { return false; }
void Append(cListObject *Object); void Append(cListObject *Object);
void Insert(cListObject *Object);
void Unlink(void); void Unlink(void);
int Index(void); int Index(void);
cListObject *Prev(void) const { return prev; } cListObject *Prev(void) const { return prev; }
@ -132,7 +133,8 @@ protected:
cListBase(void); cListBase(void);
public: public:
virtual ~cListBase(); virtual ~cListBase();
void Add(cListObject *Object); void Add(cListObject *Object, cListObject *After = NULL);
void Ins(cListObject *Object, cListObject *Before = NULL);
void Del(cListObject *Object); void Del(cListObject *Object);
virtual void Move(int From, int To); virtual void Move(int From, int To);
void Move(cListObject *From, cListObject *To); void Move(cListObject *From, cListObject *To);

37
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * The project's page is at http://www.cadsoft.de/people/kls/vdr
* *
* $Id: vdr.c 1.105 2002/05/11 11:46:40 kls Exp $ * $Id: vdr.c 1.109 2002/05/13 16:32:49 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -66,7 +66,7 @@ static void Watchdog(int signum)
{ {
// Something terrible must have happened that prevented the 'alarm()' from // Something terrible must have happened that prevented the 'alarm()' from
// being called in time, so let's get out of here: // being called in time, so let's get out of here:
esyslog(LOG_ERR, "PANIC: watchdog timer expired - exiting!"); esyslog("PANIC: watchdog timer expired - exiting!");
exit(1); exit(1);
} }
@ -269,7 +269,7 @@ int main(int argc, char *argv[])
pid_t pid = fork(); pid_t pid = fork();
if (pid < 0) { if (pid < 0) {
fprintf(stderr, "%m\n"); fprintf(stderr, "%m\n");
esyslog(LOG_ERR, "ERROR: %m"); esyslog("ERROR: %m");
return 2; return 2;
} }
if (pid != 0) if (pid != 0)
@ -289,7 +289,7 @@ int main(int argc, char *argv[])
stderr = freopen(Terminal, "w", stderr); stderr = freopen(Terminal, "w", stderr);
} }
isyslog(LOG_INFO, "VDR version %s started", VDRVERSION); isyslog("VDR version %s started", VDRVERSION);
// Load plugins: // Load plugins:
@ -301,6 +301,8 @@ int main(int argc, char *argv[])
if (!ConfigDirectory) if (!ConfigDirectory)
ConfigDirectory = VideoDirectory; ConfigDirectory = VideoDirectory;
cPlugin::SetConfigDirectory(ConfigDirectory);
Setup.Load(AddDirectory(ConfigDirectory, "setup.conf")); Setup.Load(AddDirectory(ConfigDirectory, "setup.conf"));
Channels.Load(AddDirectory(ConfigDirectory, "channels.conf")); Channels.Load(AddDirectory(ConfigDirectory, "channels.conf"));
Timers.Load(AddDirectory(ConfigDirectory, "timers.conf")); Timers.Load(AddDirectory(ConfigDirectory, "timers.conf"));
@ -324,7 +326,8 @@ int main(int argc, char *argv[])
// Start plugins: // Start plugins:
PluginManager.StartPlugins(); if (!PluginManager.StartPlugins())
return 2;
// Channel: // Channel:
@ -364,14 +367,14 @@ int main(int argc, char *argv[])
bool ForceShutdown = false; bool ForceShutdown = false;
if (WatchdogTimeout > 0) { if (WatchdogTimeout > 0) {
dsyslog(LOG_INFO, "setting watchdog timer to %d seconds", WatchdogTimeout); dsyslog("setting watchdog timer to %d seconds", WatchdogTimeout);
alarm(WatchdogTimeout); // Initial watchdog timer start alarm(WatchdogTimeout); // Initial watchdog timer start
} }
while (!Interrupted) { while (!Interrupted) {
// Handle emergency exits: // Handle emergency exits:
if (cThread::EmergencyExit()) { if (cThread::EmergencyExit()) {
esyslog(LOG_ERR, "emergency exit requested - shutting down"); esyslog("emergency exit requested - shutting down");
break; break;
} }
// Restart the Watchdog timer: // Restart the Watchdog timer:
@ -379,7 +382,7 @@ int main(int argc, char *argv[])
int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout); int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout);
if (LatencyTime > MaxLatencyTime) { if (LatencyTime > MaxLatencyTime) {
MaxLatencyTime = LatencyTime; MaxLatencyTime = LatencyTime;
dsyslog(LOG_INFO, "max. latency time %d seconds", MaxLatencyTime); dsyslog("max. latency time %d seconds", MaxLatencyTime);
} }
} }
// Channel display: // Channel display:
@ -426,7 +429,7 @@ int main(int argc, char *argv[])
cDisplayVolume::Process(key); cDisplayVolume::Process(key);
break; break;
// Power off: // Power off:
case kPower: isyslog(LOG_INFO, "Power button pressed"); case kPower: isyslog("Power button pressed");
DELETENULL(*Interact); DELETENULL(*Interact);
if (!Shutdown) { if (!Shutdown) {
Interface->Error(tr("Can't shutdown - option '-s' not given!")); Interface->Error(tr("Can't shutdown - option '-s' not given!"));
@ -532,7 +535,7 @@ int main(int argc, char *argv[])
if (!LastActivity) { if (!LastActivity) {
if (!timer || Delta > MANUALSTART) { if (!timer || Delta > MANUALSTART) {
// Apparently the user started VDR manually // Apparently the user started VDR manually
dsyslog(LOG_INFO, "assuming manual start of VDR"); dsyslog("assuming manual start of VDR");
LastActivity = Now; LastActivity = Now;
continue; // don't run into the actual shutdown procedure below continue; // don't run into the actual shutdown procedure below
} }
@ -550,7 +553,7 @@ int main(int argc, char *argv[])
if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) { if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
ForceShutdown = false; ForceShutdown = false;
if (timer) if (timer)
dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); dsyslog("next timer event at %s", ctime(&Next));
if (WatchdogTimeout > 0) if (WatchdogTimeout > 0)
signal(SIGALRM, SIG_IGN); signal(SIGALRM, SIG_IGN);
if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) { if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) {
@ -558,7 +561,7 @@ int main(int argc, char *argv[])
const char *File = timer ? timer->file : ""; const char *File = timer ? timer->file : "";
char *cmd; char *cmd;
asprintf(&cmd, "%s %ld %ld %d \"%s\" %d", Shutdown, Next, Delta, Channel, strescape(File, "\"$"), UserShutdown); asprintf(&cmd, "%s %ld %ld %d \"%s\" %d", Shutdown, Next, Delta, Channel, strescape(File, "\"$"), UserShutdown);
isyslog(LOG_INFO, "executing '%s'", cmd); isyslog("executing '%s'", cmd);
SystemExec(cmd); SystemExec(cmd);
delete cmd; delete cmd;
} }
@ -573,11 +576,13 @@ int main(int argc, char *argv[])
} }
// Disk housekeeping: // Disk housekeeping:
RemoveDeletedRecordings(); RemoveDeletedRecordings();
// Plugins housekeeping:
PluginManager.Housekeeping();
} }
} }
} }
if (Interrupted) if (Interrupted)
isyslog(LOG_INFO, "caught signal %d", Interrupted); isyslog("caught signal %d", Interrupted);
cVideoCutter::Stop(); cVideoCutter::Stop();
delete Menu; delete Menu;
delete ReplayControl; delete ReplayControl;
@ -588,12 +593,12 @@ int main(int argc, char *argv[])
Setup.Save(); Setup.Save();
cDvbApi::Cleanup(); cDvbApi::Cleanup();
if (WatchdogTimeout > 0) if (WatchdogTimeout > 0)
dsyslog(LOG_INFO, "max. latency time %d seconds", MaxLatencyTime); dsyslog("max. latency time %d seconds", MaxLatencyTime);
isyslog(LOG_INFO, "exiting"); isyslog("exiting");
if (SysLogLevel > 0) if (SysLogLevel > 0)
closelog(); closelog();
if (cThread::EmergencyExit()) { if (cThread::EmergencyExit()) {
esyslog(LOG_ERR, "emergency exit!"); esyslog("emergency exit!");
return 1; return 1;
} }
return 0; return 0;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: videodir.c 1.7 2002/01/27 12:37:26 kls Exp $ * $Id: videodir.c 1.8 2002/05/13 16:32:52 kls Exp $
*/ */
#include "videodir.h" #include "videodir.h"
@ -108,7 +108,7 @@ int OpenVideoFile(const char *FileName, int Flags)
// Incoming name must be in base video directory: // Incoming name must be in base video directory:
if (strstr(FileName, VideoDirectory) != FileName) { if (strstr(FileName, VideoDirectory) != FileName) {
esyslog(LOG_ERR, "ERROR: %s not in %s", FileName, VideoDirectory); esyslog("ERROR: %s not in %s", FileName, VideoDirectory);
errno = ENOENT; // must set 'errno' - any ideas for a better value? errno = ENOENT; // must set 'errno' - any ideas for a better value?
return -1; return -1;
} }