vdr/receiver.c
Klaus Schmidinger ec0ec6da01 Version 2.3.2
Merry Christmas to all VDR users!

It's been a very busy year for me, in which I was unable to
spend as much time on VDR as I would have liked to. But now things
are settled again and I managed to prepare a new developer version
with the most important fixes and improvements. Please feel free
to tell me if I missed something important - some things may well
have slipped under my radar ;-).

So here's my Christmas gift for you!

VDR developer version 2.3.2 is now available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.3.2.tar.bz2

A 'diff' against the previous version is available at

       ftp://ftp.tvdr.de/vdr/Developer/vdr-2.3.1-2.3.2.diff

MD5 checksums:

6dbb208ea3d59658a18912b49af175b3  vdr-2.3.2.tar.bz2
68a0ed9f01048026333939d30e0a6474  vdr-2.3.1-2.3.2.diff

WARNING:
========

This is a *developer* version. Even though *I* use it in my productive
environment, I strongly recommend that you only use it under controlled
conditions and for testing and debugging.

From the HISTORY file:
- Fixed a crash when deleting a recording (reported by Oliver Endriss).
- Fixed an overflow of PIDs in a receiver (thanks to Robert Hannebauer).
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed initializing device specific parameters in cDvbTransponderParameters.
- The function SetCurrentChannel(const cChannel *Channel) is now deprecated and
  may be removed in a future version. Use SetCurrentChannel(int ChannelNumber)
  instead.
- The SVDRP command DELC now refuses to delete the very last channel in the list,
  to avoid ending up with an empty channel list.
- The cRwLock class now allows nested read locks within a write lock from the
  same thread. This fixes possible crashes when moving or deleting channels in
  the menu or through SVDRP (as well as other operations that try to acquire a
  read lock within a write lock).
- Fixed a crash when trying to delete a channel that is being used by a timer.
- Fixed setting the current item and counter values in the Recordings menu after
  deleting the last recording in a subfolder.
- Fixed a crash when deleting a recording that is currently being replayed.
- Fixed a crash when moving a recording to a folder on a different volume.
  The cRecordingsHandler now performs its actual operations in a separate thread,
  thus avoiding locking problems and reducing the time between subsequent
  operations.
- Added a note to the description of cFont::Size(), regarding possible differences
  between it and cFont::Height() (suggested to Thomas Reufer).
- Made the cPlayer member functions FramesPerSecond, GetIndex and GetReplayMode
  'const' (thanks to Thomas Reufer).
- Fixed resuming replay at a given position, which was off by one frame (thanks
  to Thomas Reufer).
- Improved handling frame numbers to have a smoother progress display during
  replay of recordings with B-frames (thanks to Thomas Reufer).
- Fixed replaying recordings to their very end, if they don't end with an I-frame
  (thanks to Thomas Reufer).
- Implemented a frame parser for H.265 (HEVC) recordings (thanks to Thomas Reufer).
- Added cFont::Width(void) to get the default character width and allow stretched
  font drawing in high level OSDs (thanks to Thomas Reufer).
- Fixed regenerating the index of audio recordings (thanks to Thomas Reufer).
- Fixed building VDR with systemd >= 230 (thanks to Ville Skyttä).
- Sorted sources.conf by continous azimuth (thanks to Lucian Muresan).
- Added 'S58.5E Kazsat 3' to sources.conf (thanks to Aitugan Sarbassov).
- Fixed truncated date/time strings in the skins on multi-byte UTF-8 systems
  (reported by Sergey Chernyavskiy).
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Added a 'const' version of cTimers::GetTimer() (thanks to Lars Hanisch).
- Fixed a typo in the description of cTimers::GetTimersRead() (thanks to Lars
  Hanisch).
- Fixed a possible buffer overflow in handling CA descriptors (suggested by
  Lars Hanisch).
- Avoiding some duplicate code and unnecessary work in nit.c (thanks to Ville
  Skyttä).
- Added support for the systemd watchdog (thanks to Marc Perrudin),
- Added a short sleep to cTSBuffer::Action() to avoid high CPU usage (thanks to
  Sergey Chernyavskiy).
2017-02-01 00:05:46 +01:00

120 lines
2.5 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 4.1 2015/09/16 11:19:47 kls Exp $
*/
#include "receiver.h"
#include <stdio.h>
#include "tools.h"
cReceiver::cReceiver(const cChannel *Channel, int Priority)
{
device = NULL;
SetPriority(Priority);
numPids = 0;
SetPids(Channel);
}
cReceiver::~cReceiver()
{
if (device) {
const char *msg = "ERROR: cReceiver has not been detached yet! This is a design fault and VDR will abort now!";
esyslog("%s", msg);
fprintf(stderr, "%s\n", msg);
abort();
}
}
void cReceiver::SetPriority(int Priority)
{
priority = constrain(Priority, MINPRIORITY, MAXPRIORITY);
}
bool cReceiver::AddPid(int Pid)
{
if (Pid) {
if (numPids < MAXRECEIVEPIDS) {
if (!WantsPid(Pid))
pids[numPids++] = Pid;
}
else {
dsyslog("too many PIDs in cReceiver (Pid = %d)", Pid);
return false;
}
}
return true;
}
bool cReceiver::AddPids(const int *Pids)
{
if (Pids) {
while (*Pids) {
if (!AddPid(*Pids++))
return false;
}
}
return true;
}
bool cReceiver::AddPids(int Pid1, int Pid2, int Pid3, int Pid4, int Pid5, int Pid6, int Pid7, int Pid8, int Pid9)
{
return AddPid(Pid1) && AddPid(Pid2) && AddPid(Pid3) && AddPid(Pid4) && AddPid(Pid5) && AddPid(Pid6) && AddPid(Pid7) && AddPid(Pid8) && AddPid(Pid9);
}
bool cReceiver::SetPids(const cChannel *Channel)
{
numPids = 0;
if (Channel) {
channelID = Channel->GetChannelID();
return AddPid(Channel->Vpid()) &&
(Channel->Ppid() == Channel->Vpid() || AddPid(Channel->Ppid())) &&
AddPids(Channel->Apids()) &&
AddPids(Channel->Dpids()) &&
AddPids(Channel->Spids());
}
return true;
}
void cReceiver::DelPid(int Pid)
{
if (Pid) {
for (int i = 0; i < numPids; i++) {
if (pids[i] == Pid) {
for ( ; i < numPids; i++) // we also copy the terminating 0!
pids[i] = pids[i + 1];
numPids--;
return;
}
}
}
}
void cReceiver::DelPids(const int *Pids)
{
if (Pids) {
while (*Pids)
DelPid(*Pids++);
}
}
bool cReceiver::WantsPid(int Pid)
{
if (Pid) {
for (int i = 0; i < numPids; i++) {
if (pids[i] == Pid)
return true;
}
}
return false;
}
void cReceiver::Detach(void)
{
if (device)
device->Detach(this);
}