mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 17:16:51 +00:00
Support for non-cycle-free setups (e.g. where two VDRs mutually share
their DVB cards through streamdev-client/-server). Must be enabled in streamdev-server setup. Obsoletes recursion patches.
This commit is contained in:
@@ -732,8 +732,24 @@ bool cLSTRHandler::Next(bool &Last)
|
||||
return false;
|
||||
}
|
||||
|
||||
class cStreamdevLoopPrevention {
|
||||
private:
|
||||
bool Unlock;
|
||||
public:
|
||||
cStreamdevLoopPrevention(const cChannel* Channel, bool LoopPrevention): Unlock(LoopPrevention) {
|
||||
if (LoopPrevention)
|
||||
cPluginManager::CallAllServices(LOOP_PREVENTION_SERVICE, (void *)Channel);
|
||||
}
|
||||
~cStreamdevLoopPrevention() {
|
||||
if (Unlock)
|
||||
cPluginManager::CallAllServices(LOOP_PREVENTION_SERVICE, NULL);
|
||||
}
|
||||
};
|
||||
|
||||
// --- cConnectionVTP ---------------------------------------------------------
|
||||
|
||||
#define LOOP_PREVENTION(c) cStreamdevLoopPrevention LoopPrevention(c, m_LoopPrevention);
|
||||
|
||||
cConnectionVTP::cConnectionVTP(void):
|
||||
cServerConnection("VTP"),
|
||||
m_LiveSocket(NULL),
|
||||
@@ -753,6 +769,10 @@ cConnectionVTP::cConnectionVTP(void):
|
||||
m_LSTTHandler(NULL),
|
||||
m_LSTRHandler(NULL)
|
||||
{
|
||||
m_LoopPrevention = StreamdevServerSetup.LoopPrevention;
|
||||
if (m_LoopPrevention)
|
||||
// Loop prevention enabled - but is there anybody out there?
|
||||
m_LoopPrevention = cPluginManager::CallFirstService(LOOP_PREVENTION_SERVICE);
|
||||
}
|
||||
|
||||
cConnectionVTP::~cConnectionVTP()
|
||||
@@ -921,6 +941,8 @@ bool cConnectionVTP::CmdPROV(char *Opts)
|
||||
if ((chan = ChannelFromString(Opts)) == NULL)
|
||||
return Respond(550, "Undefined channel \"%s\"", Opts);
|
||||
|
||||
LOOP_PREVENTION(chan);
|
||||
|
||||
if (ProvidesChannel(chan, prio)) {
|
||||
m_TuneChannel = chan;
|
||||
m_TunePriority = prio;
|
||||
@@ -1088,6 +1110,8 @@ bool cConnectionVTP::CmdTUNE(char *Opts)
|
||||
if ((chan = ChannelFromString(Opts)) == NULL)
|
||||
return Respond(550, "Undefined channel \"%s\"", Opts);
|
||||
|
||||
LOOP_PREVENTION(chan);
|
||||
|
||||
if (chan != m_TuneChannel) {
|
||||
isyslog("streamdev-server TUNE %s: Priority unknown - using 0", Opts);
|
||||
prio = 0;
|
||||
|
Reference in New Issue
Block a user