aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/db.cpp
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-04-23 13:01:04 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-04-23 13:01:04 +0200
commit556d6244747ea2b4b3590e682948e9f708b0a069 (patch)
treed978475519d4b075c5b13547547041ea12225fef /lib/dvb/db.cpp
parent41c9e42e428c0216ef2e011985c060f79fcf8ebc (diff)
downloadenigma2-556d6244747ea2b4b3590e682948e9f708b0a069.tar.gz
enigma2-556d6244747ea2b4b3590e682948e9f708b0a069.zip
Add service flags and pid cache to recordings meta file. This adds possibility to playback services without pat/pmt, now also current selected audio pid, subtitles, pcm/ac3 delays are stored for ts playbacks
Diffstat (limited to 'lib/dvb/db.cpp')
-rw-r--r--lib/dvb/db.cpp76
1 files changed, 39 insertions, 37 deletions
diff --git a/lib/dvb/db.cpp b/lib/dvb/db.cpp
index 647afad4..ae30e360 100644
--- a/lib/dvb/db.cpp
+++ b/lib/dvb/db.cpp
@@ -265,6 +265,42 @@ void eDVBDB::reloadServicelist()
loadServicelist(CONFIGDIR"/enigma2/lamedb");
}
+void eDVBDB::parseServiceData(ePtr<eDVBService> s, std::string str)
+{
+ while ((!str.empty()) && str[1]==':') // new: p:, f:, c:%02d...
+ {
+ size_t c=str.find(',');
+ char p=str[0];
+ std::string v;
+ if (c == std::string::npos)
+ {
+ v=str.substr(2);
+ str="";
+ } else
+ {
+ v=str.substr(2, c-2);
+ str=str.substr(c+1);
+ }
+// eDebug("%c ... %s", p, v.c_str());
+ if (p == 'p')
+ s->m_provider_name=v;
+ else if (p == 'f')
+ {
+ sscanf(v.c_str(), "%x", &s->m_flags);
+ } else if (p == 'c')
+ {
+ int cid, val;
+ sscanf(v.c_str(), "%02d%x", &cid, &val);
+ s->setCacheEntry((eDVBService::cacheID)cid,val);
+ } else if (p == 'C')
+ {
+ int val;
+ sscanf(v.c_str(), "%04x", &val);
+ s->m_ca.push_front((uint16_t)val);
+ }
+ }
+}
+
/* THIS CODE IS BAD. it should be replaced by somethine better. */
void eDVBDB::loadServicelist(const char *file)
{
@@ -425,44 +461,10 @@ void eDVBDB::loadServicelist(const char *file)
fgets(line, 256, f);
if (strlen(line))
line[strlen(line)-1]=0;
- std::string str=line;
-
- if (str[1]!=':') // old ... (only service_provider)
- {
+ if (line[1]!=':') // old ... (only service_provider)
s->m_provider_name=line;
- } else
- while ((!str.empty()) && str[1]==':') // new: p:, f:, c:%02d...
- {
- size_t c=str.find(',');
- char p=str[0];
- std::string v;
- if (c == std::string::npos)
- {
- v=str.substr(2);
- str="";
- } else
- {
- v=str.substr(2, c-2);
- str=str.substr(c+1);
- }
-// eDebug("%c ... %s", p, v.c_str());
- if (p == 'p')
- s->m_provider_name=v;
- else if (p == 'f')
- {
- sscanf(v.c_str(), "%x", &s->m_flags);
- } else if (p == 'c')
- {
- int cid, val;
- sscanf(v.c_str(), "%02d%x", &cid, &val);
- s->setCacheEntry((eDVBService::cacheID)cid,val);
- } else if (p == 'C')
- {
- int val;
- sscanf(v.c_str(), "%04x", &val);
- s->m_ca.push_front((uint16_t)val);
- }
- }
+ else
+ parseServiceData(s, line);
addService(ref, s);
}