From abebaccce4e955e40ec4e29aa1a4dadde2c184d0 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 13 Jun 2013 13:12:19 +0400 Subject: [PATCH] zapit/src/femanager.cpp: another hack to find free demux for PiP --- src/zapit/src/femanager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index ac3d99652..48a633ffb 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -42,6 +42,8 @@ #include 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 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());