Skip to content

Commit

Permalink
[Updated] Optimized IPTV provider handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarCC authored and Huevos committed Oct 29, 2024
1 parent 47fc8db commit 51c71a9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
16 changes: 8 additions & 8 deletions lib/dvb/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,8 @@ RESULT eDVBService::getName(const eServiceReference &ref, std::string &name)
else
name = "(...)";

std::string res_name = "";
std::string res_provider = "";
eServiceReference::parseNameAndProviderFromName(name, res_name, res_provider);
name = res_name;

if (!res_provider.empty() && m_provider_name.empty()) {
m_provider_name = res_provider;
if (m_provider_name.empty()) {
m_provider_name = ref.prov;
}

return 0;
Expand Down Expand Up @@ -1362,7 +1357,12 @@ void eDVBDB::loadBouquet(const char *path)
else if (read_descr && !strncmp(line, "#DESCRIPTION", 12))
{
int offs = line[12] == ':' ? 14 : 13;
e->name = line+offs;
std::string name_temp = line+offs;
std::string res_name = "";
std::string res_provider = "";
eServiceReference::parseNameAndProviderFromName(name_temp, res_name, res_provider);
e->name = res_name;
e->prov = res_provider;
read_descr=false;
}
else if (!strncmp(line, "#NAME ", 6))
Expand Down
9 changes: 1 addition & 8 deletions lib/service/iservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ class eServiceReference
std::string prov;
int number;
#endif
std::string getName() const {
if (!name.empty()) {
std::vector<std::string> name_split = split(name, "");
std::string name_res = name_split[0];
return name_res;
}
return name;
}
std::string getName() const { return name; }
std::string getProvider() const { return prov; }
void setName( const std::string &s ) { name=s; }
void setProvider( const std::string &s ) { prov=s; }
Expand Down
4 changes: 0 additions & 4 deletions lib/service/servicedvb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,6 @@ RESULT eStaticServiceDVBPVRInformation::getName(const eServiceReference &ref, st
m_parser.m_name = name;
}

std::string res_name = "";
std::string res_provider = "";
eServiceReference::parseNameAndProviderFromName(name, res_name, res_provider);
name = res_name;
m_parser.m_name = name;
if (m_parser.m_prov.empty() && !ref.prov.empty()) m_parser.m_prov = ref.prov;

Expand Down
8 changes: 2 additions & 6 deletions lib/service/servicemp3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <gst/pbutils/missing-plugins.h>
#include <sys/stat.h>

#define HTTP_TIMEOUT 30
#define HTTP_TIMEOUT 60

/*
* UNUSED variable from service reference is now used as buffer flag for gstreamer
Expand Down Expand Up @@ -265,11 +265,6 @@ RESULT eStaticServiceMP3Info::getName(const eServiceReference &ref, std::string
name = ref.path;
}

std::string res_name = "";
std::string res_provider = "";
eServiceReference::parseNameAndProviderFromName(name, res_name, res_provider);
name = res_name;

return 0;
}

Expand Down Expand Up @@ -2413,6 +2408,7 @@ void eServiceMP3::playbinNotifySource(GObject *object, GParamSpec *unused, gpoin
if (!strcmp(sourcename, "souphttpsrc"))
{
g_object_set(G_OBJECT(source), "timeout", HTTP_TIMEOUT, NULL);
g_object_set(G_OBJECT(source), "retries", 20, NULL);
}
}
}
Expand Down

0 comments on commit 51c71a9

Please sign in to comment.