Skip to content

Commit

Permalink
Merge with pli
Browse files Browse the repository at this point in the history
  • Loading branch information
teamblue-e2 committed Jan 26, 2025
1 parent 1ec014a commit 5ed7563
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
15 changes: 14 additions & 1 deletion lib/dvb/dvb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ int tuner_type_channel_default(ePtr<iDVBChannelList> &channellist, const eDVBCha
return 0;
}

int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore, int &system, bool simulate)
int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore, const eDVBChannelID& ignoresr, int &system, bool simulate)
{
std::list<active_channel> &active_channels = simulate ? m_active_simulate_channels : m_active_channels;
int ret = 0;
Expand Down Expand Up @@ -1466,6 +1466,7 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons
std::vector<int*> fcc_decremented_fe_usecounts;
std::map<eDVBChannelID, int> fcc_chids;
int apply_to_ignore = 0;
int apply_to_ignoresr = 0;
if (!eFCCServiceManager::getFCCChannelID(fcc_chids))
{
for (std::map<eDVBChannelID, int>::iterator i(fcc_chids.begin()); i != fcc_chids.end(); ++i)
Expand Down Expand Up @@ -1512,6 +1513,18 @@ int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, cons
}
}

// For stream relayed channel make a check is it in the available channels and if it is ignore it
if (ignoresr) {
for (std::list<active_channel>::iterator i(active_channels.begin()); i != active_channels.end(); ++i)
{
if (i->m_channel_id == ignoresr)
{
apply_to_ignoresr = 1;
break;
}
}
}

for (std::list<active_channel>::iterator i(active_channels.begin()); i != active_channels.end(); ++i)
{
eSmartPtrList<eDVBRegisteredFrontend> &frontends = simulate ? m_simulate_frontend : m_frontend;
Expand Down
2 changes: 1 addition & 1 deletion lib/dvb/dvb.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class eDVBResourceManager: public iObject, public sigc::trackable
};

RESULT connectChannelAdded(const sigc::slot<void(eDVBChannel*)> &channelAdded, ePtr<eConnection> &connection);
int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, int &system, bool simulate=false);
int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, const eDVBChannelID& ignoresr, int &system, bool simulate=false);

/* allocate channel... */
RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel, bool simulate=false);
Expand Down
21 changes: 17 additions & 4 deletions lib/service/servicedvb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int eStaticServiceDVBInformation::isPlayable(const eServiceReference &ref, const
int system;
((const eServiceReferenceDVB&)ref).getChannelID(chid);
((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
return res_mgr->canAllocateChannel(chid, chid_ignore, system);
return res_mgr->canAllocateChannel(chid, chid_ignore, eDVBChannelID(), system);
}
return 0;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref
};
int system;
((const eServiceReferenceDVB&)*it).getChannelID(chid);
int tmp = res->canAllocateChannel(chid, chid_ignore, system, simulate);
int tmp = res->canAllocateChannel(chid, chid_ignore, eDVBChannelID(), system, simulate);
if (prio_order == 127) // ignore dvb-type priority, try all alternatives one-by-one
{
if (((tmp > 0) || (!it->path.empty())))
Expand Down Expand Up @@ -2059,8 +2059,20 @@ std::string eDVBServicePlay::getInfoString(int w)
switch (w)
{
case sProvider:
{
if (!m_dvb_service) return "";
return m_dvb_service->m_provider_name;
std::string prov = m_dvb_service->m_provider_name;
if (prov.empty()) {
eServiceReferenceDVB sRelayOrigSref;
bool res = ((const eServiceReferenceDVB&)m_reference).getSROriginal(sRelayOrigSref);
if (res) {
ePtr<eDVBService> sRelayServiceOrigSref;
eDVBDB::getInstance()->getService(sRelayOrigSref, sRelayServiceOrigSref);
return sRelayServiceOrigSref->m_provider_name;
}
}
return prov;
}
case sServiceref:
return m_reference.toString();
case sHBBTVUrl:
Expand Down Expand Up @@ -2413,7 +2425,8 @@ bool eDVBServiceBase::tryFallbackTuner(eServiceReferenceDVB &service, bool &is_s
return false;
service.getChannelID(chid); // this sets chid
eServiceReferenceDVB().getChannelID(chid_ignore); // this sets chid_ignore
if(res_mgr->canAllocateChannel(chid, chid_ignore, system)) // this sets system

if(res_mgr->canAllocateChannel(chid, chid_ignore, eDVBChannelID(), system)) // this sets system
return false;

if (eConfigManager::getConfigBoolValue("config.usage.remote_fallback_alternative", false) && !(system == iDVBFrontend::feSatellite))
Expand Down

0 comments on commit 5ed7563

Please sign in to comment.