zapit/src/femanager.cpp: another hack to find free demux for PiP

This commit is contained in:
[CST] Focus
2013-06-13 13:12:19 +04:00
parent a485591986
commit abebaccce4

View File

@@ -42,6 +42,8 @@
#include <OpenThreads/ScopedLock>
static int fedebug = 0;
static int unused_demux;
#define FEDEBUG(fmt, args...) \
do { \
if (fedebug) \
@@ -372,6 +374,7 @@ void CFEManager::linkFrontends(bool init)
INFO("linking..");
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
enabled_count = 0;
unused_demux = 0;
for(fe_map_iterator_t it = femap.begin(); it != femap.end(); it++) {
CFrontend * fe = it->second;
#if 0
@@ -423,8 +426,11 @@ void CFEManager::linkFrontends(bool init)
}
if (init && femode != CFrontend::FE_MODE_UNUSED)
fe->Init();
if (femode != CFrontend::FE_MODE_UNUSED)
if (femode != CFrontend::FE_MODE_UNUSED) {
enabled_count++;
} else if (!unused_demux) {
unused_demux = fe->fenumber + 1;
}
}
}
@@ -648,7 +654,7 @@ CFrontend * CFEManager::allocateFE(CZapitChannel * channel, bool forrecord)
#ifdef ENABLE_PIP
/* FIXME until proper demux management */
if (enabled_count < 4) {
channel->setPipDemux(PIP_DEMUX);
channel->setPipDemux(unused_demux ? unused_demux : PIP_DEMUX);
//cDemux::SetSource(PIP_DEMUX, frontend->fenumber);
}
INFO("pip demux: %d", channel->getPipDemux());