The EIT scanner now checks whether there is a proper device before adding a channel to the scan list

This commit is contained in:
Klaus Schmidinger 2024-06-27 10:49:34 +02:00
parent 2b495e0f87
commit 0360b0d0e7
2 changed files with 18 additions and 2 deletions

View File

@ -9919,7 +9919,7 @@ Video Disk Recorder Revision History
- A device is now always kept occupied if a timer is in VPS margin or needs the - A device is now always kept occupied if a timer is in VPS margin or needs the
transponder (thanks to Markus Ehrnsperger). transponder (thanks to Markus Ehrnsperger).
2024-06-24: 2024-06-27:
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed a possible access of a deleted object in the EIT scanner. - Fixed a possible access of a deleted object in the EIT scanner.
@ -9930,3 +9930,5 @@ Video Disk Recorder Revision History
Note that the string version of strreplace() has been modified, so that it Note that the string version of strreplace() has been modified, so that it
replaces all occurrences of the search string, not just the first one. replaces all occurrences of the search string, not just the first one.
- Removed leftover cMenuRecordings::SetPath(). - Removed leftover cMenuRecordings::SetPath().
- The EIT scanner now checks whether there is a proper device before adding a
channel to the scan list.

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: eitscan.c 5.4 2024/05/19 14:55:57 kls Exp $ * $Id: eitscan.c 5.5 2024/06/27 10:49:34 kls Exp $
*/ */
#include "eitscan.h" #include "eitscan.h"
@ -44,11 +44,23 @@ int cScanData::Compare(const cListObject &ListObject) const
// --- cScanList ------------------------------------------------------------- // --- cScanList -------------------------------------------------------------
class cScanList : public cList<cScanData> { class cScanList : public cList<cScanData> {
private:
bool HasDeviceForChannelEIT(const cChannel *Channel) const;
public: public:
void AddTransponders(const cList<cChannel> *Channels); void AddTransponders(const cList<cChannel> *Channels);
void AddTransponder(const cChannel *Channel); void AddTransponder(const cChannel *Channel);
}; };
bool cScanList::HasDeviceForChannelEIT(const cChannel *Channel) const
{
for (int i = 0; i < cDevice::NumDevices(); i++) {
cDevice *Device = cDevice::GetDevice(i);
if (Device && Device->ProvidesEIT() && Device->ProvidesTransponder(Channel))
return true;
}
return false;
}
void cScanList::AddTransponders(const cList<cChannel> *Channels) void cScanList::AddTransponders(const cList<cChannel> *Channels)
{ {
for (const cChannel *ch = Channels->First(); ch; ch = Channels->Next(ch)) for (const cChannel *ch = Channels->First(); ch; ch = Channels->Next(ch))
@ -59,6 +71,8 @@ void cScanList::AddTransponders(const cList<cChannel> *Channels)
void cScanList::AddTransponder(const cChannel *Channel) void cScanList::AddTransponder(const cChannel *Channel)
{ {
if (Channel->Source() && Channel->Transponder() && (Setup.EPGScanMaxChannel <= 0 || Channel->Number() < Setup.EPGScanMaxChannel)) { if (Channel->Source() && Channel->Transponder() && (Setup.EPGScanMaxChannel <= 0 || Channel->Number() < Setup.EPGScanMaxChannel)) {
if (!HasDeviceForChannelEIT(Channel))
return;
for (cScanData *sd = First(); sd; sd = Next(sd)) { for (cScanData *sd = First(); sd; sd = Next(sd)) {
if (sd->Source() == Channel->Source() && ISTRANSPONDER(sd->Transponder(), Channel->Transponder())) if (sd->Source() == Channel->Source() && ISTRANSPONDER(sd->Transponder(), Channel->Transponder()))
return; return;