summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-05-08 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-05-08 18:00:00 +0200
commitc23522ade253e23b5bf6141d7d7e7335d6abcd1d (patch)
tree283ea2d0dd325e6614ea031f3fcdcd9534a103ee /device.c
parent782b517c51eaa6d2641fe9b6801afdad50be8586 (diff)
downloadvdr-patch-lnbsharing-c23522ade253e23b5bf6141d7d7e7335d6abcd1d.tar.gz
vdr-patch-lnbsharing-c23522ade253e23b5bf6141d7d7e7335d6abcd1d.tar.bz2
Version 1.3.24vdr-1.3.24
- Now including the optional user defined Make.config from the 'libsi' Makefile (thanks to Ville Skyttä). - Updated the Danish OSD texts (thanks to Mogens Elneff). - Fixed a memory leak in tComponent (thanks to Stefan Huelswitt and Daniel Thompson). - Fixed a memory leak in cDvbPlayer (thanks to Stefan Huelswitt). - Added missing text internationalization for "Starting EPG scan" (thanks to Matthias Lötzke). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed handling transparent areas in cDvbSpuBitmap (thanks to Marco Schlüßler). - Now also considering the "EPG linger time" when saving the EPG data to file or listing it via LSTE (thanks to Roman Krenický). - Fixed handling fragments of less than 4 byte in cPesAssembler (thanks to Reinhard Nissl). - Fixed a bug in libsi's SubtitlingDescriptor::getLength() (thanks to Marco Schlüßler). - When reading the channels.conf file, duplicate channels (i.e. ones that have the same channel ID) are now automatically deleted and only the first one is actually stored. - Fixed handling lifetime when deciding whether to delete a recording (thanks to Udo Richter). - Fixed timeout handling in cRwLock::Lock() (thanks to Sascha Volkenandt for reporting this one). - Since there are several places in thread.c where a timeout value is calculated, this has been put into a separate function. - The timer status now has a new bit that is set when that timer is currently recording (suggested by Matthias Schniedermeyer). See man vdr(5) for details. - Removed scaling coordinates in letterbox mode from cDvbSpu - the DVD plugin, which was the only one needing this, doesn't need it any more (thanks to Marco Schlüßler). - No longer retuning or restarting a recording if only the language code of an audio or Dolby PID changes. - Now preferring budget cards when selecting a DVB device for recording. - Recordings now avoid zero sized video data files (thanks to Wolfgang Fitz). - Some rearrangements in cDvbPlayer::Action() to avoid lockups on NPTL systems (thanks to Reinhard Nissl). - Fixed a wrong inheritance in libsi's SubtitlingDescriptor::Subtitling (thanks to Marco Schlüßler).
Diffstat (limited to 'device.c')
-rw-r--r--device.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/device.c b/device.c
index d6ab891..806c137 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.99 2005/02/27 13:55:15 kls Exp $
+ * $Id: device.c 1.101 2005/05/07 15:04:17 kls Exp $
*/
#include "device.h"
@@ -34,7 +34,7 @@ public:
int ExpectedLength(void) { return PacketSize(data); }
static int PacketSize(const uchar *data);
int Length(void) { return length; }
- const uchar *Data(void) { return data; }
+ const uchar *Data(void) { return data; } // only valid if Length() >= 4
void Reset(void);
void Put(uchar c);
void Put(const uchar *Data, int Length);
@@ -76,7 +76,7 @@ bool cPesAssembler::Realloc(int Size)
void cPesAssembler::Put(uchar c)
{
- if (!length) {
+ if (length < 4) {
tag = (tag << 8) | c;
if ((tag & 0xFFFFFF00) == 0x00000100) {
if (Realloc(4)) {
@@ -84,6 +84,8 @@ void cPesAssembler::Put(uchar c)
length = 4;
}
}
+ else if (length < 3)
+ length++;
}
else if (Realloc(length + 1))
data[length++] = c;
@@ -91,7 +93,7 @@ void cPesAssembler::Put(uchar c)
void cPesAssembler::Put(const uchar *Data, int Length)
{
- while (!length && Length > 0) {
+ while (length < 4 && Length > 0) {
Put(*Data++);
Length--;
}
@@ -268,7 +270,7 @@ cDevice *cDevice::GetDevice(int Index)
cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers)
{
cDevice *d = NULL;
- int select = 7, pri;
+ int select = 8, pri;
for (int i = 0; i < numDevices; i++) {
bool ndr;
@@ -277,16 +279,18 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDe
pri = 0; // receiving and allows additional receivers
else if (d && !device[i]->Receiving() && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
pri = 1; // free and fewer Ca's
+ else if (!device[i]->Receiving() && !device[i]->HasDecoder())
+ pri = 2; // free and not a full featured card
else if (!device[i]->Receiving() && !device[i]->IsPrimaryDevice())
- pri = 2; // free and not the primary device
+ pri = 3; // free and not the primary device
else if (!device[i]->Receiving())
- pri = 3; // free
+ pri = 4; // free
else if (d && device[i]->Priority() < d->Priority())
- pri = 4; // receiving but priority is lower
+ pri = 5; // receiving but priority is lower
else if (d && device[i]->Priority() == d->Priority() && device[i]->ProvidesCa(Channel) < d->ProvidesCa(Channel))
- pri = 5; // receiving with same priority but fewer Ca's
+ pri = 6; // receiving with same priority but fewer Ca's
else
- pri = 6; // all others
+ pri = 7; // all others
if (pri < select) {
select = pri;
d = device[i];