vdr/receiver.c
Klaus Schmidinger 527748826c Version 1.1.6
- Re-visited the race condition fix in the cDvbPlayer (thanks again to Andreas
  Schultz).
- Changed the VFAT handling to allow users who normally use it but have forgotten
  to set it when compiling a new version of VDR to at least see their recordings
  made with VFAT enabled (thanks to Christian Rienecker).
- Added some missing teletext PIDs (thanks to Joerg Riechardt).
- Fixed PID handling for cReceiver.
- Added a missing #include to ringbuffer.c (thanks to Martin Hammerschmid).
- Now using CC, CFLAGS, CXX and CXXFLAGS in Makefile.
- Changed the cDevice class to allow plugins to implement their own devices (see
  PLUGINS.html for details).
2002-08-04 18:00:00 +02:00

59 lines
1.1 KiB
C

/*
* receiver.c: The basic receiver interface
*
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: receiver.c 1.3 2002/07/28 15:14:49 kls Exp $
*/
#include <stdarg.h>
#include <stdio.h>
#include "receiver.h"
#include "tools.h"
cReceiver::cReceiver(int Ca, int Priority, int NumPids, ...)
{
device = NULL;
ca = Ca;
priority = Priority;
for (int i = 0; i < MAXRECEIVEPIDS; i++)
pids[i] = 0;
if (NumPids) {
va_list ap;
va_start(ap, NumPids);
int n = 0;
while (n < MAXRECEIVEPIDS && NumPids--) {
if ((pids[n] = va_arg(ap, int)) != 0)
n++;
}
va_end(ap);
}
else
esyslog("ERROR: cReceiver called without a PID!");
}
cReceiver::~cReceiver()
{
Detach();
}
bool cReceiver::WantsPid(int Pid)
{
if (Pid) {
for (int i = 0; i < MAXRECEIVEPIDS; i++) {
if (pids[i] == Pid)
return true;
if (!pids[i])
break;
}
}
return false;
}
void cReceiver::Detach(void)
{
if (device)
device->Detach(this);
}