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

Fixed the 'else if' branch in cDevice::GetDeviceForTransponder(), which hasn't been active since version 1.7.29

This commit is contained in:
Klaus Schmidinger 2020-06-27 10:24:46 +02:00
parent 848c65fe4f
commit a526eee165
5 changed files with 19 additions and 4 deletions

View File

@ -3612,6 +3612,8 @@ Helmut Binder <cco@aon.at>
'902' to make it valid for all countries
for adjusting device selection in GetDeviceForTransponder() to that in GetDevice()
for adding CRC check of the CAT in cCaPidReceiver::Receive()
for reporting that the 'else if' branch in cDevice::GetDeviceForTransponder() hasn't
been active since version 1.7.29
Ulrich Eckhardt <uli@uli-eckhardt.de>
for reporting a problem with shutdown after user inactivity in case a plugin is

View File

@ -9491,3 +9491,10 @@ Video Disk Recorder Revision History
- Now adding CPPFLAGS to CXXFLAGS to allow extra preprocessor flags to be given when
doing make (suggested by Tobisa Grimm).
- Added CRC check of the CAT in cCaPidReceiver::Receive() (thanks to Helmut Binder).
- Fixed the 'else if' branch in cDevice::GetDeviceForTransponder(), which hasn't
been active since version 1.7.29 (reported by Helmut Binder). The original purpose of
this branch was to use a device that is currently not recording for switching to the
transponder of an upcoming VPS timer. However, this caused problems with more than
two bonded devices, which was "fixed" in version 1.7.29. Apparently this fix merely
rendered the whole code branch inactive. Now this branch is only executed for devices
that are not bonded.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 4.33 2020/06/25 13:46:16 kls Exp $
* $Id: device.c 4.34 2020/06/27 10:24:46 kls Exp $
*/
#include "device.h"
@ -427,7 +427,7 @@ cDevice *cDevice::GetDeviceForTransponder(const cChannel *Channel, int Priority)
if (d->ProvidesTransponder(Channel)) {
if (d->MaySwitchTransponder(Channel))
return d; // this device may switch to the transponder without disturbing any receiver or live view
else if (!d->Occupied() && d->MaySwitchTransponder(Channel)) { // MaySwitchTransponder() implicitly calls Occupied()
else if (!d->Occupied() && !d->IsBonded()) { // MaySwitchTransponder() implicitly calls Occupied()
if (d->Priority() < Priority && (!Device || d->Priority() < Device->Priority()))
Device = d; // use this one only if no other with less impact can be found
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.h 4.16 2020/06/10 14:52:43 kls Exp $
* $Id: device.h 4.17 2020/06/27 10:24:46 kls Exp $
*/
#ifndef __DEVICE_H
@ -211,6 +211,11 @@ protected:
///< device (On = false), it should do so in this function.
///< A derived class must call the MakePrimaryDevice() function of its
///< base class.
virtual bool IsBonded(void) const { return false; }
///< Returns true if this device is bonded to an other device.
///< Only implemented by cDvbDevice and used in GetDeviceForTransponder().
///< May be dropped in a future version, if a better solution is found.
///< Do not use otherwise!
public:
bool IsPrimaryDevice(void) const { return this == primaryDevice && HasDecoder(); }
int CardIndex(void) const { return cardIndex; }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbdevice.h 4.6 2019/03/10 12:01:15 kls Exp $
* $Id: dvbdevice.h 4.7 2020/06/27 10:24:46 kls Exp $
*/
#ifndef __DVBDEVICE_H
@ -179,6 +179,7 @@ public:
///< Returns true if any devices are available.
protected:
int adapter, frontend;
virtual bool IsBonded(void) const { return bondedDevice; }
private:
int fd_dvr, fd_ca;
bool checkTsBuffer;