mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Improved the [eid]syslog() macros
This commit is contained in:
parent
49fcbf19fa
commit
d4893ad1fe
26
config.c
26
config.c
@ -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;
|
||||||
|
6
config.h
6
config.h
@ -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.115 2002/05/12 09:18:44 kls Exp $
|
* $Id: config.h 1.116 2002/05/13 16:28:16 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __CONFIG_H
|
||||||
@ -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
126
dvbapi.c
@ -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;
|
||||||
}
|
}
|
||||||
|
6
dvbosd.c
6
dvbosd.c
@ -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
62
eit.c
@ -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
4
i18n.c
@ -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;
|
||||||
|
12
interface.c
12
interface.c
@ -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 16:00:31 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
48
menu.c
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
osdbase.c
16
osdbase.c
@ -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());
|
||||||
|
18
plugin.c
18
plugin.c
@ -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.c 1.4 2002/05/13 16:08:22 kls Exp $
|
* $Id: plugin.c 1.5 2002/05/13 16:31:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
@ -139,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;
|
||||||
}
|
}
|
||||||
@ -147,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);
|
||||||
@ -175,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;
|
||||||
}
|
}
|
||||||
@ -191,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;
|
||||||
}
|
}
|
||||||
@ -210,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;
|
||||||
@ -299,7 +299,7 @@ bool cPluginManager::StartPlugins(void)
|
|||||||
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;
|
||||||
if (!p->Start())
|
if (!p->Start())
|
||||||
return false;
|
return false;
|
||||||
@ -354,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);
|
||||||
}
|
}
|
||||||
|
24
recording.c
24
recording.c
@ -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;
|
||||||
}
|
}
|
||||||
|
6
remote.c
6
remote.c
@ -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
14
remux.c
@ -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
|
||||||
|
14
ringbuffer.c
14
ringbuffer.c
@ -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/19 12:38:44 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
32
svdrp.c
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
thread.c
10
thread.c
@ -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 11:51:56 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!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
42
tools.c
42
tools.c
@ -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.64 2002/05/12 11:37:24 kls Exp $
|
* $Id: tools.c 1.65 2002/05/13 16:32:12 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 -----------------------------------------------------------
|
||||||
|
12
tools.h
12
tools.h
@ -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.44 2002/05/12 11:14:18 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
|
||||||
|
|
||||||
|
30
vdr.c
30
vdr.c
@ -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.108 2002/05/13 16:09:06 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:
|
||||||
|
|
||||||
@ -367,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:
|
||||||
@ -382,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:
|
||||||
@ -429,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!"));
|
||||||
@ -535,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
|
||||||
}
|
}
|
||||||
@ -553,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)) {
|
||||||
@ -561,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;
|
||||||
}
|
}
|
||||||
@ -582,7 +582,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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;
|
||||||
@ -593,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;
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user