use parent service reference for query EPG to build a .eit file when a parent is...
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 17 Mar 2006 13:30:13 +0000 (13:30 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 17 Mar 2006 13:30:13 +0000 (13:30 +0000)
(on subservices)

lib/dvb/idvb.h
lib/service/servicedvbrecord.cpp

index 5909e76..13f2008 100644 (file)
@@ -162,6 +162,20 @@ struct eServiceReferenceDVB: public eServiceReference
        eTransportStreamID getParentTransportStreamID() const { return eTransportStreamID(data[6]); }
        void setParentTransportStreamID( eTransportStreamID tsid ) { data[6]=tsid.get(); }
 
        eTransportStreamID getParentTransportStreamID() const { return eTransportStreamID(data[6]); }
        void setParentTransportStreamID( eTransportStreamID tsid ) { data[6]=tsid.get(); }
 
+       eServiceReferenceDVB getParentServiceReference() const
+       {
+               eServiceReferenceDVB tmp(*this);
+               if (data[4] && data[5])
+               {
+                       tmp.data[1] = data[5];
+                       tmp.data[2] = data[6];
+                       tmp.data[5] = tmp.data[6] = 0;
+               }
+               else
+                       tmp.type = idInvalid;
+               return tmp;
+       }
+
        eServiceReferenceDVB(eDVBNamespace dvbnamespace, eTransportStreamID transport_stream_id, eOriginalNetworkID original_network_id, eServiceID service_id, int service_type)
                :eServiceReference(eServiceReference::idDVB, 0)
        {
        eServiceReferenceDVB(eDVBNamespace dvbnamespace, eTransportStreamID transport_stream_id, eOriginalNetworkID original_network_id, eServiceID service_id, int service_type)
                :eServiceReference(eServiceReference::idDVB, 0)
        {
index a035935..e150ae1 100644 (file)
@@ -48,10 +48,13 @@ RESULT eDVBServiceRecord::prepare(const char *filename, time_t begTime, time_t e
                {
                        eEPGCache::getInstance()->Lock();
                        const eit_event_struct *event = 0;
                {
                        eEPGCache::getInstance()->Lock();
                        const eit_event_struct *event = 0;
+                       eServiceReferenceDVB ref = m_ref.getParentServiceReference();
+                       if (!ref.valid())
+                               ref = m_ref;
                        if ( eit_event_id != -1 )
                        {
                                eDebug("query epg event id %d", eit_event_id);
                        if ( eit_event_id != -1 )
                        {
                                eDebug("query epg event id %d", eit_event_id);
-                               eEPGCache::getInstance()->lookupEventId(m_ref, eit_event_id, event);
+                               eEPGCache::getInstance()->lookupEventId(ref, eit_event_id, event);
                        }
                        if ( !event && (begTime != -1 && endTime != -1) )
                        {
                        }
                        if ( !event && (begTime != -1 && endTime != -1) )
                        {
@@ -64,7 +67,7 @@ RESULT eDVBServiceRecord::prepare(const char *filename, time_t begTime, time_t e
                                        beg.tm_hour, beg.tm_min, beg.tm_sec,
                                        end.tm_hour, end.tm_min, end.tm_sec,
                                        query.tm_hour, query.tm_min, query.tm_sec);
                                        beg.tm_hour, beg.tm_min, beg.tm_sec,
                                        end.tm_hour, end.tm_min, end.tm_sec,
                                        query.tm_hour, query.tm_min, query.tm_sec);
-                               eEPGCache::getInstance()->lookupEventTime(m_ref, queryTime, event);
+                               eEPGCache::getInstance()->lookupEventTime(ref, queryTime, event);
                        }
                        if ( event )
                        {
                        }
                        if ( event )
                        {