fix non working recording on dm800 when a recording is started during ts playback
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 9 Jul 2009 10:20:36 +0000 (12:20 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 9 Jul 2009 10:21:49 +0000 (12:21 +0200)
lib/dvb/dvb.cpp
lib/dvb/dvb.h

index e6d9a25de6a0fe5841494a34196db8ba1dcf8104..6b0270883ff97f37079db042302cee8649cb0464 100644 (file)
@@ -438,7 +438,9 @@ alloc_fe_by_id_not_possible:
        return err;
 }
 
        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. */
 {
                /* 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, ePtr<eDVBA
 
        if (m_boxtype == DM800 || m_boxtype == DM500HD) // dm800 / 500hd
        {
 
        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)
                for (; i != m_demux.end(); ++i, ++n)
                {
                        if (!i->m_inuse)
@@ -510,6 +513,7 @@ RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
        }
        else if (m_boxtype == DM8000)
        {
        }
        else if (m_boxtype == DM8000)
        {
+               cap |= capHoldDecodeReference; // this is checked in eDVBChannel::getDemux
                for (; i != m_demux.end(); ++i, ++n)
                {
                        if (fe)
                for (; i != m_demux.end(); ++i, ++n)
                {
                        if (fe)
@@ -1693,17 +1697,24 @@ RESULT eDVBChannel::getDemux(ePtr<iDVBDemux> &demux, int cap)
 
                if (m_mgr->allocateDemux(m_frontend ? (eDVBRegisteredFrontend*)*m_frontend : (eDVBRegisteredFrontend*)0, our_demux, cap))
                        return -1;
 
                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. */
                /* 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;
 }
 
        return 0;
 }
 
index 413462d60360ce1109a6dc47e818a9208987df1e..7b3200066d2b9f4508adf932b34f1d2f382c2e9f 100644 (file)
@@ -209,7 +209,7 @@ public:
 
        RESULT allocateFrontendByIndex(ePtr<eDVBAllocatedFrontend> &fe, int slot_index);
                        /* allocate a demux able to filter on the selected frontend. */
 
        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
 #ifdef SWIG
 public:
 #endif