git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add optional notification of childs when parent moves
[enigma2.git]
/
lib
/
dvb
/
dvb.cpp
diff --git
a/lib/dvb/dvb.cpp
b/lib/dvb/dvb.cpp
index 55aa6ea9c62cc15a17dbc755c0edb4c574a471ac..2a188ee1d81d7811899737eb3f400e1b26689778 100644
(file)
--- a/
lib/dvb/dvb.cpp
+++ b/
lib/dvb/dvb.cpp
@@
-273,12
+273,23
@@
RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
int n=0;
/* FIXME: hardware demux policy */
if (!(cap & iDVBChannel::capDecode))
int n=0;
/* FIXME: hardware demux policy */
if (!(cap & iDVBChannel::capDecode))
- ++i, ++n;
+ {
+ if (m_demux.size() > 2) /* assumed to be true, otherwise we have lost anyway */
+ {
+ ++i, ++n;
+ ++i, ++n;
+ }
+ }
for (; i != m_demux.end(); ++i, ++n)
for (; i != m_demux.end(); ++i, ++n)
- if ((!i->m_inuse) && ((!fe) || (i->m_adapter == fe->m_adapter)))
+ {
+ int is_decode = n < 2;
+
+ int in_use = is_decode ? (i->m_demux->getRefCount() != 2) : i->m_inuse;
+
+ if ((!in_use) && ((!fe) || (i->m_adapter == fe->m_adapter)))
{
{
- if ((cap & iDVBChannel::capDecode) &&
n
)
+ if ((cap & iDVBChannel::capDecode) &&
!is_decode
)
continue;
demux = new eDVBAllocatedDemux(i);
continue;
demux = new eDVBAllocatedDemux(i);
@@
-288,6
+299,7
@@
RESULT eDVBResourceManager::allocateDemux(eDVBRegisteredFrontend *fe, ePtr<eDVBA
demux->get().setSourcePVR(0);
return 0;
}
demux->get().setSourcePVR(0);
return 0;
}
+ }
eDebug("demux not found");
return -1;
}
eDebug("demux not found");
return -1;
}
@@
-997,6
+1009,11
@@
RESULT eDVBChannel::getDemux(ePtr<iDVBDemux> &demux, int cap)
demux = *our_demux;
/* don't hold a reference to the decoding demux, we don't need it. */
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;
return 0;
if (cap & capDecode)
our_demux = 0;
return 0;
@@
-1045,10
+1062,7
@@
RESULT eDVBChannel::playFile(const char *file)
eDebug("can't open /dev/misc/pvr - you need to buy the new(!) $$$ box! (%m)"); // or wait for the driver to be improved.
return -ENODEV;
}
eDebug("can't open /dev/misc/pvr - you need to buy the new(!) $$$ box! (%m)"); // or wait for the driver to be improved.
return -ENODEV;
}
-
- m_state = state_ok;
- m_stateChanged(this);
-
+
m_pvr_thread = new eFilePushThread();
m_pvr_thread->enablePVRCommit(1);
m_pvr_thread->setScatterGather(this);
m_pvr_thread = new eFilePushThread();
m_pvr_thread->enablePVRCommit(1);
m_pvr_thread->setScatterGather(this);
@@
-1062,6
+1076,9
@@
RESULT eDVBChannel::playFile(const char *file)
}
CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
}
CONNECT(m_pvr_thread->m_event, eDVBChannel::pvrEvent);
+ m_state = state_ok;
+ m_stateChanged(this);
+
return 0;
}
return 0;
}