1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

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 replaying with DEBUG_OSD=1
for fixing a crash when selecting the "Jump" function directly after setting for fixing a crash when selecting the "Jump" function directly after setting
an editing mark an editing mark
for reporting a possible endless loop in shifting recordings between DVB cards
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than 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 same name was manually deleted on a system with more than one video directory
(thanks to Dirk Wiebel for reporting this one). (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 - Added some DVB-T channels for Berlin (Germany) to channels.conf.terr (thanks to
Andreas Roedl). Andreas Roedl).
@ -1210,3 +1210,5 @@ Video Disk Recorder Revision History
editing mark (thanks to Steffen Koch for reporting and Stefan Huelswitt for editing mark (thanks to Steffen Koch for reporting and Stefan Huelswitt for
fixing this one). fixing this one).
- Fixed some missing ',' in i18n.c (thanks to Matthias Hilbig). - 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 * 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.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 #ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.0.0" #define VDRVERSION "1.0.1"
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

View File

@ -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.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" #include "dvbapi.h"
@ -1812,21 +1812,24 @@ bool cDvbApi::SetPrimaryDvbApi(int n)
return false; 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 // 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: // 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 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 (Recording()) {
if (ProvidesCa(Ca) // this device provides the requested Ca if (ProvidesCa(Ca) // this device provides the requested Ca
&& (Ca != this->Ca() // the requested Ca is different from the one currently used... && (Ca != this->Ca() // the requested Ca is different from the one currently used...
|| Priority > this->Priority())) { // ...or the request comes from a higher priority || Priority > this->Priority())) { // ...or the request comes from a higher priority
cDvbApi *d = NULL; cDvbApi *d = NULL;
int Provides[MAXDVBAPI]; int Provides[MAXDVBAPI];
UsedCards |= (1 << CardIndex());
for (int i = 0; i < NumDvbApis; i++) { 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 ((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 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)) { if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
d = dvbApi[i]; d = dvbApi[i];
ShiftLevel = sl; ShiftLevel = sl;

View File

@ -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.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 #ifndef __DVBAPI_H
@ -104,7 +104,7 @@ private:
static int useDvbApi; static int useDvbApi;
int cardIndex; int cardIndex;
int caCaps[MAXCACAPS]; int caCaps[MAXCACAPS];
int CanShift(int Ca, int Priority); int CanShift(int Ca, int Priority, int UsedCards = 0);
public: public:
static cDvbApi *PrimaryDvbApi; static cDvbApi *PrimaryDvbApi;
static void SetUseDvbApi(int n); static void SetUseDvbApi(int n);