mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
zapit/src/femanager.cpp: ifdef dynamic demux allocation, it disabled atm
Origin commit data
------------------
Commit: cc2e3862ad
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-02-26 (Tue, 26 Feb 2013)
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#define MAX_FE 4
|
||||
#define MAX_ADAPTERS 1
|
||||
//#define DYNAMIC_DEMUX
|
||||
//#define MAKE_FE_KEY(adapter, number) ((adapter << 8) | (number & 0xFF))
|
||||
|
||||
#define FECONFIGFILE CONFIGDIR "/zapit/frontend.conf"
|
||||
|
@@ -570,6 +570,7 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
|
||||
return free_frontend;
|
||||
}
|
||||
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
int CFEManager::getDemux(transponder_id_t id)
|
||||
{
|
||||
for (unsigned int i = 1; i < dmap.size(); i++) {
|
||||
@@ -608,6 +609,7 @@ bool CFEManager::haveFreeDemux()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // DYNAMIC_DEMUX
|
||||
|
||||
CFrontend * CFEManager::allocateFE(CZapitChannel * channel, bool forrecord)
|
||||
{
|
||||
@@ -616,6 +618,7 @@ CFrontend * CFEManager::allocateFE(CZapitChannel * channel, bool forrecord)
|
||||
fedebug = 1;
|
||||
CFrontend * frontend = getFrontend(channel);
|
||||
if (frontend) {
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
int dnum = getDemux(channel->getTransponderId());
|
||||
INFO("record demux: %d", dnum);
|
||||
channel->setRecordDemux(dnum);
|
||||
@@ -624,6 +627,11 @@ CFrontend * CFEManager::allocateFE(CZapitChannel * channel, bool forrecord)
|
||||
} else {
|
||||
cDemux::SetSource(dnum, frontend->fenumber);
|
||||
}
|
||||
#else
|
||||
channel->setRecordDemux(frontend->fenumber+1);
|
||||
cDemux::SetSource(frontend->fenumber+1, frontend->fenumber);
|
||||
#endif
|
||||
|
||||
}
|
||||
return frontend;
|
||||
}
|
||||
@@ -675,9 +683,11 @@ bool CFEManager::lockFrontend(CFrontend * frontend, CZapitChannel * channel)
|
||||
have_locked = true;
|
||||
|
||||
if (channel) {
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
int di = channel->getRecordDemux();
|
||||
if ((unsigned int) di < dmap.size())
|
||||
dmap[di].Lock(channel->getTransponderId());
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -688,12 +698,14 @@ bool CFEManager::unlockFrontend(CFrontend * frontend, bool unlock_demux)
|
||||
have_locked = false;
|
||||
frontend->Unlock();
|
||||
if (unlock_demux) {
|
||||
#ifdef DYNAMIC_DEMUX
|
||||
for (unsigned int i = 1; i < dmap.size(); i++) {
|
||||
if(dmap[i].tpid == frontend->getTsidOnid()) {
|
||||
dmap[i].Unlock();
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
|
||||
CFrontend * fe = it->second;
|
||||
|
Reference in New Issue
Block a user