Fixed a possible endless loop in shifting recordings between DVB cards

This commit is contained in:
Klaus Schmidinger 2002-04-21 10:09:56 +02:00
parent c47891d786
commit dfb1d78abf
5 changed files with 14 additions and 8 deletions

View File

@ -122,6 +122,7 @@ Stefan Huelswitt <huels@iname.com>
for fixing a crash when replaying with DEBUG_OSD=1
for fixing a crash when selecting the "Jump" function directly after setting
an editing mark
for reporting a possible endless loop in shifting recordings between DVB cards
Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than

View File

@ -1191,7 +1191,7 @@ Video Disk Recorder Revision History
same name was manually deleted on a system with more than one video directory
(thanks to Dirk Wiebel for reporting this one).
2002-04-20: Version 1.0.1
2002-04-21: Version 1.0.1
- Added some DVB-T channels for Berlin (Germany) to channels.conf.terr (thanks to
Andreas Roedl).
@ -1210,3 +1210,5 @@ Video Disk Recorder Revision History
editing mark (thanks to Steffen Koch for reporting and Stefan Huelswitt for
fixing this one).
- Fixed some missing ',' in i18n.c (thanks to Matthias Hilbig).
- Fixed a possible endless loop in shifting recordings between DVB cards (thanks
to Stefan Huelswitt for reporting this one).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.109 2002/04/07 13:08:12 kls Exp $
* $Id: config.h 1.110 2002/04/21 10:09:56 kls Exp $
*/
#ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h"
#include "tools.h"
#define VDRVERSION "1.0.0"
#define VDRVERSION "1.0.1"
#define MAXPRIORITY 99
#define MAXLIFETIME 99

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.c 1.171 2002/04/20 10:45:33 kls Exp $
* $Id: dvbapi.c 1.172 2002/04/21 09:54:40 kls Exp $
*/
#include "dvbapi.h"
@ -1812,21 +1812,24 @@ bool cDvbApi::SetPrimaryDvbApi(int n)
return false;
}
int cDvbApi::CanShift(int Ca, int Priority)
int cDvbApi::CanShift(int Ca, int Priority, int UsedCards)
{
// Test whether a recording on this DVB device can be shifted to another one
// in order to perform a new recording with the given Ca and Priority on this device:
int ShiftLevel = -1; // default means this device can't be shifted
if (UsedCards & (1 << CardIndex()) != 0)
return ShiftLevel; // otherwise we would get into a loop
if (Recording()) {
if (ProvidesCa(Ca) // this device provides the requested Ca
&& (Ca != this->Ca() // the requested Ca is different from the one currently used...
|| Priority > this->Priority())) { // ...or the request comes from a higher priority
cDvbApi *d = NULL;
int Provides[MAXDVBAPI];
UsedCards |= (1 << CardIndex());
for (int i = 0; i < NumDvbApis; i++) {
if ((Provides[i] = dvbApi[i]->ProvidesCa(this->Ca())) != 0) { // this device is basicly able to do the job
if (dvbApi[i] != this) { // it is not _this_ device
int sl = dvbApi[i]->CanShift(this->Ca(), Priority); // this is the original Priority!
int sl = dvbApi[i]->CanShift(this->Ca(), Priority, UsedCards); // this is the original Priority!
if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
d = dvbApi[i];
ShiftLevel = sl;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.h 1.68 2002/03/10 10:50:00 kls Exp $
* $Id: dvbapi.h 1.69 2002/04/21 09:49:22 kls Exp $
*/
#ifndef __DVBAPI_H
@ -104,7 +104,7 @@ private:
static int useDvbApi;
int cardIndex;
int caCaps[MAXCACAPS];
int CanShift(int Ca, int Priority);
int CanShift(int Ca, int Priority, int UsedCards = 0);
public:
static cDvbApi *PrimaryDvbApi;
static void SetUseDvbApi(int n);