return err;
}
-RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap)
+#define capHoldDecodeReference 64
+
+RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int &cap)
{
/* find first unused demux which is on same adapter as frontend (or any, if PVR)
never use the first one unless we need a decoding demux. */
if (m_boxtype == DM800 || m_boxtype == DM500HD) // dm800 / 500hd
{
+ cap |= capHoldDecodeReference; // this is checked in eDVBChannel::getDemux
for (; i != m_demux.end(); ++i, ++n)
{
if (!i->m_inuse)
}
else if (m_boxtype == DM8000)
{
+ cap |= capHoldDecodeReference; // this is checked in eDVBChannel::getDemux
for (; i != m_demux.end(); ++i, ++n)
{
if (fe)
if (m_mgr->allocateDemux(m_frontend ? (eDVBRegisteredFrontend*)*m_frontend : (eDVBRegisteredFrontend*)0, our_demux, cap))
return -1;
- }
- demux = *our_demux;
+ demux = *our_demux;
+
/* don't hold a reference to the decoding demux, we don't need it. */
/* FIXME: by dropping the 'allocated demux' in favour of the 'iDVBDemux',
the refcount is lost. thus, decoding demuxes are never allocated.
this poses a big problem for PiP. */
- if (cap & capDecode)
- our_demux = 0;
+
+ if (cap & capHoldDecodeReference) // this is set in eDVBResourceManager::allocateDemux for Dm500HD/DM800 and DM8000
+ ;
+ else if (cap & capDecode)
+ our_demux = 0;
+ }
+ else
+ demux = *our_demux;
+
return 0;
}
RESULT allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index);
/* allocate a demux able to filter on the selected frontend. */
- RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int cap);
+ RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBAllocatedDemux> &demux, int &cap);
#ifdef SWIG
public:
#endif