mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Now waiting explicitly until all CAM slots are ready before switching to the initial channel when VDR is started
This commit is contained in:
parent
e02d608bce
commit
1df6a87249
4
HISTORY
4
HISTORY
@ -8148,3 +8148,7 @@ Video Disk Recorder Revision History
|
|||||||
Eike Sauer).
|
Eike Sauer).
|
||||||
- Fixed deleting the source recording after moving it to a different volume (reported
|
- Fixed deleting the source recording after moving it to a different volume (reported
|
||||||
by Christoph Haubrich).
|
by Christoph Haubrich).
|
||||||
|
- Now waiting explicitly until all CAM slots are ready before switching to the
|
||||||
|
initial channel when VDR is started. This is necessary in case CI adapters are
|
||||||
|
used that are not physically connected to a dedicated device. The respective checks
|
||||||
|
in cDvbDevice have been removed to avoid redundancy.
|
||||||
|
33
ci.c
33
ci.c
@ -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: ci.c 3.7 2014/01/15 10:20:48 kls Exp $
|
* $Id: ci.c 3.8 2014/01/16 11:43:33 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ci.h"
|
#include "ci.h"
|
||||||
@ -1536,15 +1536,6 @@ void cCiAdapter::AddCamSlot(cCamSlot *CamSlot)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cCiAdapter::Ready(void)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < MAX_CAM_SLOTS_PER_ADAPTER; i++) {
|
|
||||||
if (camSlots[i] && !camSlots[i]->Ready())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cCiAdapter::Action(void)
|
void cCiAdapter::Action(void)
|
||||||
{
|
{
|
||||||
cTPDU TPDU;
|
cTPDU TPDU;
|
||||||
@ -1566,8 +1557,6 @@ void cCiAdapter::Action(void)
|
|||||||
|
|
||||||
// --- cCamSlot --------------------------------------------------------------
|
// --- cCamSlot --------------------------------------------------------------
|
||||||
|
|
||||||
cCamSlots CamSlots;
|
|
||||||
|
|
||||||
#define MODULE_CHECK_INTERVAL 500 // ms
|
#define MODULE_CHECK_INTERVAL 500 // ms
|
||||||
#define MODULE_RESET_TIMEOUT 2 // s
|
#define MODULE_RESET_TIMEOUT 2 // s
|
||||||
|
|
||||||
@ -2034,6 +2023,26 @@ uchar *cCamSlot::Decrypt(uchar *Data, int &Count)
|
|||||||
return Data;
|
return Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- cCamSlots -------------------------------------------------------------
|
||||||
|
|
||||||
|
cCamSlots CamSlots;
|
||||||
|
|
||||||
|
bool cCamSlots::WaitForAllCamSlotsReady(int Timeout)
|
||||||
|
{
|
||||||
|
for (time_t t0 = time(NULL); time(NULL) - t0 < Timeout; ) {
|
||||||
|
bool ready = true;
|
||||||
|
for (cCamSlot *CamSlot = CamSlots.First(); CamSlot; CamSlot = CamSlots.Next(CamSlot)) {
|
||||||
|
if (!CamSlot->Ready()) {
|
||||||
|
ready = false;
|
||||||
|
cCondWait::SleepMs(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ready)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// --- cChannelCamRelation ---------------------------------------------------
|
// --- cChannelCamRelation ---------------------------------------------------
|
||||||
|
|
||||||
#define CAM_CHECKED_TIMEOUT 15 // seconds before a CAM that has been checked for a particular channel will be checked again
|
#define CAM_CHECKED_TIMEOUT 15 // seconds before a CAM that has been checked for a particular channel will be checked again
|
||||||
|
14
ci.h
14
ci.h
@ -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: ci.h 3.4 2014/01/14 11:53:52 kls Exp $
|
* $Id: ci.h 3.5 2014/01/16 11:45:08 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CI_H
|
#ifndef __CI_H
|
||||||
@ -113,8 +113,6 @@ public:
|
|||||||
cCiAdapter(void);
|
cCiAdapter(void);
|
||||||
virtual ~cCiAdapter();
|
virtual ~cCiAdapter();
|
||||||
///< The derived class must call Cancel(3) in its destructor.
|
///< The derived class must call Cancel(3) in its destructor.
|
||||||
virtual bool Ready(void);
|
|
||||||
///< Returns 'true' if all present CAMs in this adapter are ready.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class cTPDU;
|
class cTPDU;
|
||||||
@ -267,7 +265,15 @@ public:
|
|||||||
///< constructor to true in order to receive the CA pid data.
|
///< constructor to true in order to receive the CA pid data.
|
||||||
};
|
};
|
||||||
|
|
||||||
class cCamSlots : public cList<cCamSlot> {};
|
class cCamSlots : public cList<cCamSlot> {
|
||||||
|
public:
|
||||||
|
bool WaitForAllCamSlotsReady(int Timeout = 0);
|
||||||
|
///< Waits until all CAM slots have become ready, or the given Timeout
|
||||||
|
///< (seconds) has expired. While waiting, the Ready() function of each
|
||||||
|
///< CAM slot is called in turn, until they all return true.
|
||||||
|
///< Returns true if all CAM slots have become ready within the given
|
||||||
|
///< timeout.
|
||||||
|
};
|
||||||
|
|
||||||
extern cCamSlots CamSlots;
|
extern cCamSlots CamSlots;
|
||||||
|
|
||||||
|
@ -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: dvbdevice.c 3.8 2014/01/02 10:30:15 kls Exp $
|
* $Id: dvbdevice.c 3.9 2014/01/16 11:45:22 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbdevice.h"
|
#include "dvbdevice.h"
|
||||||
@ -1320,13 +1320,6 @@ bool cDvbDevice::QueryDeliverySystems(int fd_frontend)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cDvbDevice::Ready(void)
|
|
||||||
{
|
|
||||||
if (ciAdapter)
|
|
||||||
return ciAdapter->Ready();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cDvbDevice::BondDevices(const char *Bondings)
|
bool cDvbDevice::BondDevices(const char *Bondings)
|
||||||
{
|
{
|
||||||
UnBondDevices();
|
UnBondDevices();
|
||||||
|
@ -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: dvbdevice.h 3.3 2014/01/01 14:00:56 kls Exp $
|
* $Id: dvbdevice.h 3.4 2014/01/16 11:45:35 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __DVBDEVICE_H
|
#ifndef __DVBDEVICE_H
|
||||||
@ -185,7 +185,6 @@ public:
|
|||||||
virtual ~cDvbDevice();
|
virtual ~cDvbDevice();
|
||||||
int Adapter(void) const { return adapter; }
|
int Adapter(void) const { return adapter; }
|
||||||
int Frontend(void) const { return frontend; }
|
int Frontend(void) const { return frontend; }
|
||||||
virtual bool Ready(void);
|
|
||||||
virtual cString DeviceType(void) const;
|
virtual cString DeviceType(void) const;
|
||||||
virtual cString DeviceName(void) const;
|
virtual cString DeviceName(void) const;
|
||||||
static bool BondDevices(const char *Bondings);
|
static bool BondDevices(const char *Bondings);
|
||||||
|
4
vdr.c
4
vdr.c
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* The project's page is at http://www.tvdr.de
|
* The project's page is at http://www.tvdr.de
|
||||||
*
|
*
|
||||||
* $Id: vdr.c 3.7 2013/12/25 11:24:26 kls Exp $
|
* $Id: vdr.c 3.8 2014/01/16 11:25:03 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -810,6 +810,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT))
|
if (!cDevice::WaitForAllDevicesReady(DEVICEREADYTIMEOUT))
|
||||||
dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT);
|
dsyslog("not all devices ready after %d seconds", DEVICEREADYTIMEOUT);
|
||||||
|
if (!CamSlots.WaitForAllCamSlotsReady(DEVICEREADYTIMEOUT))
|
||||||
|
dsyslog("not all CAM slots ready after %d seconds", DEVICEREADYTIMEOUT);
|
||||||
if (*Setup.InitialChannel) {
|
if (*Setup.InitialChannel) {
|
||||||
if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files
|
if (isnumber(Setup.InitialChannel)) { // for compatibility with old setup.conf files
|
||||||
if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel)))
|
if (cChannel *Channel = Channels.GetByNumber(atoi(Setup.InitialChannel)))
|
||||||
|
Loading…
Reference in New Issue
Block a user