aboutsummaryrefslogtreecommitdiff
path: root/lib/service
diff options
context:
space:
mode:
Diffstat (limited to 'lib/service')
-rw-r--r--lib/service/event.cpp21
-rw-r--r--lib/service/event.h2
-rw-r--r--lib/service/service.cpp22
-rw-r--r--lib/service/servicedvb.cpp23
4 files changed, 39 insertions, 29 deletions
diff --git a/lib/service/event.cpp b/lib/service/event.cpp
index f84c38b7..2d0f83a4 100644
--- a/lib/service/event.cpp
+++ b/lib/service/event.cpp
@@ -204,7 +204,7 @@ RESULT eServiceEvent::getComponentData(ePtr<eComponentData> &dest, int tagnum) c
return -1;
}
-RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) const
+RESULT eServiceEvent::getLinkageService(eServiceReference &service, eServiceReference &parent, int num) const
{
std::list<eServiceReference>::const_iterator it =
m_linkage_services.begin();
@@ -213,6 +213,25 @@ RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) con
if ( it != m_linkage_services.end() )
{
service = *it;
+ eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) service;
+ eServiceReferenceDVB &current = (eServiceReferenceDVB&) parent;
+ subservice.setDVBNamespace(current.getDVBNamespace());
+ if ( current.getParentTransportStreamID().get() )
+ {
+ subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
+ subservice.setParentServiceID( current.getParentServiceID() );
+ }
+ else
+ {
+ subservice.setParentTransportStreamID( current.getTransportStreamID() );
+ subservice.setParentServiceID( current.getServiceID() );
+ }
+ if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
+ subservice.getParentServiceID() == subservice.getServiceID() )
+ {
+ subservice.setParentTransportStreamID( eTransportStreamID(0) );
+ subservice.setParentServiceID( eServiceID(0) );
+ }
return 0;
}
service.type = eServiceReference::idInvalid;
diff --git a/lib/service/event.h b/lib/service/event.h
index 0a6891aa..9ee6538b 100644
--- a/lib/service/event.h
+++ b/lib/service/event.h
@@ -53,7 +53,7 @@ public:
std::string getBeginTimeString() const;
SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
int getNumOfLinkageServices() const { return m_linkage_services.size(); }
- SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, int num) const;
+ SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
};
TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
diff --git a/lib/service/service.cpp b/lib/service/service.cpp
index 150a0cd3..a490c3d7 100644
--- a/lib/service/service.cpp
+++ b/lib/service/service.cpp
@@ -7,8 +7,8 @@
eServiceReference::eServiceReference(const std::string &string)
{
const char *c=string.c_str();
- int pathl=-1;
-
+ int pathl=0;
+
if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 )
{
memset( data, 0, sizeof(data) );
@@ -17,7 +17,19 @@ eServiceReference::eServiceReference(const std::string &string)
}
if (pathl)
- path=c+pathl;
+ {
+ const char *pathstr = c+pathl;
+ const char *namestr = strchr(pathstr, ':');
+ if (namestr)
+ {
+ if (pathstr != namestr)
+ path.assign(pathstr, namestr-pathstr);
+ if (*(namestr+1))
+ name=namestr+1;
+ }
+ else
+ path=pathstr;
+ }
}
std::string eServiceReference::toString() const
@@ -27,10 +39,10 @@ std::string eServiceReference::toString() const
ret += ":";
ret += getNum(flags);
for (unsigned int i=0; i<sizeof(data)/sizeof(*data); ++i)
- {
ret+=":"+ getNum(data[i], 0x10);
- }
ret+=":"+path;
+ if (name.length())
+ ret+=":"+name;
return ret;
}
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp
index 9cba0aaf..15deff62 100644
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -1037,29 +1037,8 @@ RESULT eDVBServicePlay::getSubservice(eServiceReference &sub, unsigned int n)
ePtr<eServiceEvent> evt;
if (!m_event_handler.getEvent(evt, 0))
{
- if (!evt->getLinkageService(sub, n))
- {
- eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) sub;
- eServiceReferenceDVB &current = (eServiceReferenceDVB&) m_reference;
- subservice.setDVBNamespace(current.getDVBNamespace());
- if ( current.getParentTransportStreamID().get() )
- {
- subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
- subservice.setParentServiceID( current.getParentServiceID() );
- }
- else
- {
- subservice.setParentTransportStreamID( current.getTransportStreamID() );
- subservice.setParentServiceID( current.getServiceID() );
- }
- if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
- subservice.getParentServiceID() == subservice.getServiceID() )
- {
- subservice.setParentTransportStreamID( eTransportStreamID(0) );
- subservice.setParentServiceID( eServiceID(0) );
- }
+ if (!evt->getLinkageService(sub, m_reference, n))
return 0;
- }
}
sub.type=eServiceReference::idInvalid;
return -1;