From: ghost Date: Thu, 9 Jul 2009 10:20:36 +0000 (+0200) Subject: fix non working recording on dm800 when a recording is started during ts playback X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=6c64f5122744f89b948540faad3352fbacbc6c58 fix non working recording on dm800 when a recording is started during ts playback --- diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index e6d9a25..6b02708 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -438,7 +438,9 @@ alloc_fe_by_id_not_possible: return err; } -RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux, int cap) +#define capHoldDecodeReference 64 + +RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr &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. */ @@ -455,6 +457,7 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtrm_inuse) @@ -510,6 +513,7 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux, int cap) 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; } diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 413462d..7b32000 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -209,7 +209,7 @@ public: RESULT allocateFrontendByIndex(ePtr &fe, int slot_index); /* allocate a demux able to filter on the selected frontend. */ - RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux, int cap); + RESULT allocateDemux(eDVBRegisteredFrontend *fe, ePtr &demux, int &cap); #ifdef SWIG public: #endif