Skip to content

Commit

Permalink
[eDVBDB]
Browse files Browse the repository at this point in the history
* improve reset lcndb
  • Loading branch information
jbleyel committed Sep 3, 2024
1 parent 8d933ff commit ee99c75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/dvb/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,11 @@ void eDVBDB::loadServiceListV5(FILE * f)
eDebug("[eDVBDB] Loaded %d channels/transponders and %d services.", tcount, scount);
}

void eDVBDB::resetLcnDB()
void eDVBDB::resetLcnDB(int dvb_namespace)
{
for (auto &kv : m_lcnmap)
{
kv.second.resetFound();
kv.second.resetFound(dvb_namespace);
}
}

Expand Down
18 changes: 10 additions & 8 deletions lib/dvb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct LCNData
int LCN_BROADCAST;
int LCN_GUI;
int LCN_SCANNED;
int NS;
std::string PROVIDER;
std::string PROVIDER_GUI;
std::string SERVICENAME;
Expand Down Expand Up @@ -46,11 +47,11 @@ struct LCNData
SERVICENAME = "";
SERVICENAME_GUI = "";
FOUND = true;
NS = 0;
}

eServiceReferenceDVB parse(const char *line, int version)
{
int ns;
int onid;
int tsid;
int sid;
Expand All @@ -60,13 +61,13 @@ struct LCNData
// will be removed
if (version == 1)
{
if (sscanf(line, "%x:%x:%x:%x:%d:%d", &ns, &onid, &tsid, &sid, &LCN_BROADCAST, &SIGNAL) == 6)
return eServiceReferenceDVB(eDVBNamespace(ns), eTransportStreamID(tsid), eOriginalNetworkID(onid), eServiceID(sid), 0);
if (sscanf(line, "%x:%x:%x:%x:%d:%d", &NS, &onid, &tsid, &sid, &LCN_BROADCAST, &SIGNAL) == 6)
return eServiceReferenceDVB(eDVBNamespace(NS), eTransportStreamID(tsid), eOriginalNetworkID(onid), eServiceID(sid), 0);
else
return eServiceReferenceDVB();
}

if (sscanf(line, "%x:%x:%x:%x:%d:%d:%d:%d:%[^\n]", &sid, &tsid, &onid, &ns, &SIGNAL, &LCN_BROADCAST, &LCN_SCANNED, &LCN_GUI, buffer) == 9)
if (sscanf(line, "%x:%x:%x:%x:%d:%d:%d:%d:%[^\n]", &sid, &tsid, &onid, &NS, &SIGNAL, &LCN_BROADCAST, &LCN_SCANNED, &LCN_GUI, buffer) == 9)
{
// eDebug("[eDVBDB] LCNData parse %X:%X:%X:%X: LCN_BROADCAST %d LCN_SCANNED %d LCN_GUI %d", sid, tsid, onid, ns, LCN_BROADCAST, LCN_SCANNED, LCN_GUI);
auto Data = split_str(buffer);
Expand All @@ -80,7 +81,7 @@ struct LCNData
SERVICENAME_GUI = Data[3];
}
}
return eServiceReferenceDVB(eDVBNamespace(ns), eTransportStreamID(tsid), eOriginalNetworkID(onid), eServiceID(sid), 0);
return eServiceReferenceDVB(eDVBNamespace(NS), eTransportStreamID(tsid), eOriginalNetworkID(onid), eServiceID(sid), 0);
}
return eServiceReferenceDVB();
}
Expand Down Expand Up @@ -120,9 +121,10 @@ struct LCNData
}
}

void resetFound()
void resetFound(int dvb_namespace)
{
FOUND = false;
if(dvb_namespace == 0 || NS == dvb_namespace)
FOUND = false;
}

};
Expand Down Expand Up @@ -201,9 +203,9 @@ class eDVBDB: public iDVBChannelList
virtual ~eDVBDB();
int renumberBouquet(eBouquet &bouquet, int startChannelNum = 1);
void addLcnToDB(int ns, int onid, int tsid, int sid, uint16_t lcn, uint32_t signal);
void resetLcnDB();
void saveLcnDB();
#endif
void resetLcnDB(int dvb_namespace=0);
eServiceReference searchReference(int tsid, int onid, int sid);
void setNumberingMode(int numberingMode);
void setLoadUnlinkedUserbouquets(bool value) { m_load_unlinked_userbouquets=value; }
Expand Down
5 changes: 0 additions & 5 deletions lib/dvb/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,11 +1278,6 @@ void eDVBScan::start(const eSmartPtrList<iDVBFrontendParameters> &known_transpon
m_new_services.clear();
m_last_service = m_new_services.end();

if (m_flags & scanRemoveServices)
{
eDVBDB::getInstance()->resetLcnDB();
}

if (m_flags & scanBlindSearch)
{
/*
Expand Down

0 comments on commit ee99c75

Please sign in to comment.