Index: libs/libmythtv/eithelper.cpp
===================================================================
--- libs/libmythtv/eithelper.cpp	(Revision 13090)
+++ libs/libmythtv/eithelper.cpp	(Arbeitskopie)
@@ -225,16 +225,19 @@
 
     uint chanid = GetChanID(eit->ServiceID(), eit->OriginalNetworkID(),
                             eit->TSID());
-    if (!chanid)
+
+    uint tableid   = eit->TableID();
+
+    if (!chanid && tableid != TableID::PR_EIT)	 
         return;
 
-    uint tableid   = eit->TableID();
     uint version   = eit->Version();
     for (uint i = 0; i < eit->EventCount(); i++)
     {
         // Skip event if we have already processed it before...
-        if (!eitcache->IsNewEIT(chanid, tableid, version, eit->EventID(i),
-                              eit->EndTimeUnixUTC(i)))
+        if ((tableid != TableID::PR_EIT)
+            && (!eitcache->IsNewEIT(chanid, tableid, version, eit->EventID(i),
+                              eit->EndTimeUnixUTC(i))))
         {
             continue;
         }
@@ -347,11 +350,79 @@
         if (content_data)
         {
             ContentDescriptor content(content_data);
-            category      = content.GetDescription(0);
-            category_type = content.GetMythCategory(0);
+	 
+            // fix events without real content data for Premiere EIT 
+            if ((tableid == TableID::PR_EIT) && (content.Nibble(0)==0x00)){  
+                if(content.UserNibble(0)==0x1)  
+                { 
+                    category_type = kCategoryMovie; 
+                    subtitle.length() < 2 ? category = QObject::tr("Movie") : category = subtitle; 
+                } 
+                else if(content.UserNibble(0)==0x0)  
+                { 
+                    category_type = kCategorySports; 
+                    subtitle.length() < 2 ? category = QObject::tr("Sports") : category = subtitle; 
+                } 
+            } 
+            else  
+            {   
+        	category      = content.GetDescription(0);
+        	category_type = content.GetMythCategory(0);
+	    }
         }
 
-        desc_list_t contentIds =
+        if (tableid == TableID::PR_EIT) 
+        { 
+        // Find all transmission descriptors for this event 
+            desc_list_t transmissions = 
+                MPEGDescriptor::FindAll(list, DescriptorID::pr_event_transmission); 
+	            for(uint j=0; j<transmissions.size(); j++) 
+            { 
+                PremiereTransmissionDescriptor transmission(transmissions[j]); 
+                uint descriptor_length = transmission.DescriptorLength(); 
+                uint networkid         = transmission.OriginalNetworkID(); 
+                uint tsid              = transmission.TSID(); 
+                uint serviceid         = transmission.ServiceID(); 
+                
+                uint chanid = GetChanID(serviceid, networkid, tsid); 
+             
+                if (!chanid) 
+                { 
+                    VERBOSE(VB_GENERAL, LOC + QString("No channid for NIT:%1 TID:%2 SID:%3. Possible new feed channel or wrong eit data").arg(networkid).arg(tsid).arg(serviceid)); 
+                    continue; 
+                } 
+                uint pos = 0;  
+                // find all transmissions for this event 
+                while (pos<descriptor_length-6) 
+                { 
+                    unsigned char startdate[5]; 
+                    memcpy(startdate, transmission.StartDate(pos), 2); 
+                    // get all start times on this day 
+                    for (uint k=0; k<transmission.TransmissionCount(pos); k+=3) 
+                    { 
+                        memcpy(&startdate[2], transmission.StartTime(pos+k), 3); 
+                        QDateTime starttime = MythUTCToLocal(dvbdate2qt(startdate)); 
+                        EITFixUp::TimeFix(starttime); 
+                        QDateTime endtime   = starttime.addSecs(eit->DurationInSeconds(i)); 
+	            QString programId = "", seriesId = "";
+
+		    DBEvent *event = new DBEvent(chanid, 
+                                                 title,     subtitle,      description, 
+                                                 category,  category_type, 
+                                                 starttime, endtime,       fix, 
+                                                 false,     subtitled, 
+                                                 stereo,    hdtv, 
+	                                         seriesId,  programId);
+                        db_events.enqueue(event); 
+                    } 
+                    // set pos to next transmission 
+                    pos += 3 + transmission.TransmissionCount(pos); 
+                } 
+            } 
+        } 
+        else 
+        { 
+            desc_list_t contentIds =
             MPEGDescriptor::FindAll(list, DescriptorID::dvb_content_identifier);
         QString programId = "", seriesId = "";
         for (uint j = 0; j < contentIds.size(); j++)
@@ -381,7 +452,7 @@
                                      stereo,    hdtv,
                                      seriesId,  programId);
         db_events.enqueue(event);
-    }
+    }   }
 }
 
 void EITHelper::PruneEITCache(uint timestamp)
Index: libs/libmythtv/eithelper.h
===================================================================
--- libs/libmythtv/eithelper.h	(Revision 13090)
+++ libs/libmythtv/eithelper.h	(Arbeitskopie)
@@ -47,6 +47,7 @@
 class EventInformationTable;
 class ExtendedTextTable;
 class DVBEventInformationTable;
+class DVBPremiereEventInformationTable;
 
 class EITHelper
 {
Index: libs/libmythtv/mpeg/dvbtables.cpp
===================================================================
--- libs/libmythtv/mpeg/dvbtables.cpp	(Revision 13090)
+++ libs/libmythtv/mpeg/dvbtables.cpp	(Arbeitskopie)
@@ -165,6 +165,8 @@
     // Dish Network Long Term Future Event Information for all transports
     is_eit |= (TableID::DN_EITbego <= table_id &&
                TableID::DN_EITendo >= table_id);
+    // Premiere Event Information for option channels
+    is_eit |= TableID::PR_EIT == table_id;
 
     return is_eit;
 }
Index: libs/libmythtv/mpeg/dvbstreamdata.cpp
===================================================================
--- libs/libmythtv/mpeg/dvbstreamdata.cpp	(Revision 13090)
+++ libs/libmythtv/mpeg/dvbstreamdata.cpp	(Arbeitskopie)
@@ -141,6 +141,10 @@
         is_eit |= (TableID::DN_EITbego <= table_id &&
                    TableID::DN_EITendo >= table_id);
     }
+    if (DVB_PR_SPORT_EIT_PID == pid || DVB_PR_DIRECT_EIT_PID == pid)
+    {
+        is_eit |= TableID::PR_EIT == table_id;
+    }
     if (is_eit)
     {
         uint service_id = psip.TableIDExtension();
@@ -309,6 +313,27 @@
         return true;
     }
 
+    if ((DVB_PR_SPORT_EIT_PID || DVB_PR_DIRECT_EIT_PID) &&
+        DVBEventInformationTable::IsEIT(psip.TableID()))
+    {
+        QMutexLocker locker(&_listener_lock);
+        if (!_dvb_eit_listeners.size() && !_eit_helper)
+            return true;
+
+        uint service_id = psip.TableIDExtension();
+        SetVersionEIT(psip.TableID(), service_id, psip.Version());
+        SetEITSectionSeen(psip.TableID(), service_id, psip.Section());
+
+        DVBPremiereEventInformationTable eit(psip);
+        for (uint i = 0; i < _dvb_eit_listeners.size(); i++)
+            _dvb_eit_listeners[i]->HandleEIT(&eit);
+
+        if (_eit_helper)
+            _eit_helper->AddEIT(&eit);
+
+        return true;
+    }
+
     return false;
 }
 
@@ -354,6 +379,16 @@
         {
             add_pids.push_back(DVB_DNLONG_EIT_PID);
         }
+        if (find(cur_pids.begin(), cur_pids.end(),
+                 (uint) DVB_PR_SPORT_EIT_PID) == cur_pids.end())
+        {
+            add_pids.push_back(DVB_PR_SPORT_EIT_PID);
+        }
+        if (find(cur_pids.begin(), cur_pids.end(),
+                 (uint) DVB_PR_DIRECT_EIT_PID) == cur_pids.end())
+        {
+            add_pids.push_back(DVB_PR_DIRECT_EIT_PID);
+        }
     }
     else
     {
@@ -369,6 +404,16 @@
         {
             del_pids.push_back(DVB_DNLONG_EIT_PID);
         }
+        if (find(cur_pids.begin(), cur_pids.end(),
+                 (uint) DVB_PR_SPORT_EIT_PID) != cur_pids.end())
+        {
+            del_pids.push_back(DVB_PR_SPORT_EIT_PID);
+        }
+        if (find(cur_pids.begin(), cur_pids.end(),
+                 (uint) DVB_PR_DIRECT_EIT_PID) != cur_pids.end())
+        {
+            del_pids.push_back(DVB_PR_DIRECT_EIT_PID);
+        }
     }
 
     return add_pids.size() || del_pids.size();
Index: libs/libmythtv/mpeg/mpegtables.h
===================================================================
--- libs/libmythtv/mpeg/mpegtables.h	(Revision 13090)
+++ libs/libmythtv/mpeg/mpegtables.h	(Arbeitskopie)
@@ -187,6 +187,10 @@
     // Dishnet longterm EIT is on pid 0x300
     DVB_DNLONG_EIT_PID = 0x0300,
 
+    // Premiere EIT for Direct/Sport PPV
+    DVB_PR_DIRECT_EIT_PID = 0x0b11,
+    DVB_PR_SPORT_EIT_PID = 0x0b12,
+
     ATSC_PSIP_PID = 0x1ffb,
 };
 
@@ -236,6 +240,9 @@
         // Dishnet Longterm EIT data
         DN_EITbego = 0x80, // always on pid 0x300
         DN_EITendo = 0xfe, // always on pid 0x300
+        
+        // Premiere Eit for Direct and Sport
+        PR_EIT     = 0xA0,
 
         // ARIB
         ARIBbeg  = 0x80,
Index: libs/libmythtv/mpeg/dvbdescriptors.h
===================================================================
--- libs/libmythtv/mpeg/dvbdescriptors.h	(Revision 13090)
+++ libs/libmythtv/mpeg/dvbdescriptors.h	(Arbeitskopie)
@@ -1674,4 +1674,40 @@
 };
 
 
+class PremiereTransmissionDescriptor : public MPEGDescriptor
+{
+  public:
+    PremiereTransmissionDescriptor(const unsigned char* data) : MPEGDescriptor(data)
+    {
+    //       Name             bits  loc  expected value
+    // descriptor_tag           8   0.0       0xF2
+        assert(DescriptorID::pr_event_transmission == DescriptorTag());
+    // descriptor_length        8   1.0
+    }
+
+    // transport id            16   2.0
+    uint TSID() const
+        { return (_data[2] << 8) | _data[3]; }
+    // network id              16   4.0
+    uint OriginalNetworkID() const
+        { return (_data[4] << 8) | _data[5]; }
+    // service id              16   6.0
+    uint ServiceID() const
+        { return (_data[6] << 8) | _data[7]; }
+
+    // for(i=0;i<N;i+=2+1+count) 
+    // start date              16   8.0
+    const unsigned char* StartDate(uint i) const
+        { return &_data[8 + i]; }  
+    // transmission count       8  10.0
+    uint TransmissionCount(uint i) const
+        { return (_data[10 + i]); }
+    // start_time              24  11.0+x
+    const unsigned char* StartTime(uint i) const
+        { return &_data[11 + i];  }
+      
+    QString toString() const { return QString("TransmissionDescriptor(stub)"); }
+};
+
+
 #endif
Index: libs/libmythtv/mpeg/dvbtables.h
===================================================================
--- libs/libmythtv/mpeg/dvbtables.h	(Revision 13090)
+++ libs/libmythtv/mpeg/dvbtables.h	(Arbeitskopie)
@@ -221,16 +221,17 @@
     // last_section_number      8   7.0
         Parse();
     }
+    virtual ~DVBEventInformationTable(){}
 
     // service_id              16   3.0
-    uint ServiceID(void) const { return TableIDExtension(); }
+    virtual uint ServiceID(void) const { return TableIDExtension(); }
 
     // transport_stream_id     16   8.0
-    uint TSID(void) const
+    virtual uint TSID(void) const
         { return (psipdata()[0]<<8) | psipdata()[1]; }
 
     // original_network_id     16  10.0
-    uint OriginalNetworkID(void) const
+    virtual uint OriginalNetworkID(void) const
         { return (psipdata()[2]<<8) | psipdata()[3]; }
 
     // segment_last_section_num 8  12.0
@@ -240,7 +241,7 @@
     uint LastTableID(void) const
         { return psipdata()[5]; }
 
-    uint EventCount() const { return _ptrs.size()-1; }
+    virtual uint EventCount() const { return _ptrs.size()-1; }
 
     // for(i=0;i<N;i++) {
     //   event_id              16   0.0+x
@@ -260,7 +261,7 @@
     //   duration              24   7.0+x
     const unsigned char *Duration(uint i) const
         { return _ptrs[i]+7; }
-    uint DurationInSeconds(uint i) const
+    virtual uint DurationInSeconds(uint i) const
     {
         return ((byteBCD2int(Duration(i)[0]) * 3600) +
                 (byteBCD2int(Duration(i)[1]) * 60) +
@@ -271,16 +272,16 @@
     //   free_CA_mode           1  10.3+x
     bool IsScrambled(uint i) const { return bool(_ptrs[i][10] & 0x10); }
     //   descriptors_loop_len  12  10.4+x
-    uint DescriptorsLength(uint i) const
+    virtual uint DescriptorsLength(uint i) const
         { return ((_ptrs[i][10]<<8) | (_ptrs[i][11])) & 0xfff; }
     //   for(i=0;i<N;i++)       y  12.0+x
     //     { descriptor() }
-    const unsigned char* Descriptors(uint i) const
+    virtual const unsigned char* Descriptors(uint i) const
         { return _ptrs[i] + 12; }
     //   }
     //CRC_32 32 rpchof
 
-    void Parse(void) const;
+    virtual void Parse(void) const;
 
     static bool IsEIT(uint table_id);
 
@@ -314,4 +315,50 @@
     time_t UTCUnix(void) const { return dvbdate2unix(UTCdata()); }
 };
 
+class DVBPremiereEventInformationTable : public DVBEventInformationTable 
+{ 
+  public: 
+    DVBPremiereEventInformationTable(const DVBEventInformationTable& table) : DVBEventInformationTable(table) 
+    { 
+    // table_id                 8   0.0       0xA0 
+        assert(IsEIT(TableID())); 
+    // section_syntax_indicator 1   1.0          1 
+    // private_indicator        1   1.1          1 
+    // reserved                 2   1.2          3 
+// section_length          12   1.4 
+    // reserved                 2   5.0          3 
+    // version_number           5   5.2 
+    // current_next_indicator   1   5.7          1 
+    // section_number           8   6.0 
+    // last_section_number      8   7.0 
+        Parse(); 
+    } 
+    ~DVBPremiereEventInformationTable(){} 
+ 
+    // content_id              32   0.0 
+    uint ContentID(void) const 
+        { return (psipdata()[0]<<24) | (psipdata()[1]<<16) | (psipdata()[2]<<8) | psipdata()[3]; } 
+ 
+    // return dummy values for compatitbility 
+    uint ServiceID(void) const { return 18; } 
+    uint OriginalNetworkID(void) const { return 133; } 
+    uint TSID(void) const { return 4; } 
+    uint EventCount(void) const { return 1; } 
+ 
+    // event_duration          24   4.0 
+    uint DurationInSeconds(uint i) const  
+        { return ((byteBCD2int(psipdata()[4]) * 3600) + 
+                  (byteBCD2int(psipdata()[5]) * 60) + 
+                  (byteBCD2int(psipdata()[6]))); } 
+ 
+    // descriptor length        7   8.0 
+    uint DescriptorsLength(uint i) const 
+        { return ((psipdata()[7] & 0x0F) << 8) | psipdata()[8]; } 
+ 
+    // descriptor length        x   9.0 
+    const unsigned char* Descriptors(uint i) const 
+     { return &psipdata()[9]; } 
+ 
+    void Parse(void) const {}; 
+}; 
 #endif // _DVB_TABLES_H_
Index: libs/libmythtv/mpeg/mpegdescriptors.h
===================================================================
--- libs/libmythtv/mpeg/mpegdescriptors.h	(Revision 13090)
+++ libs/libmythtv/mpeg/mpegdescriptors.h	(Arbeitskopie)
@@ -129,6 +129,9 @@
         DCC_arriving_request        = 0xA9,
         DRM_control                 = 0xAA,
         atsc_content_identifier     = 0xB6,
+
+        // PREMIERE
+        pr_event_transmission       = 0xF2,
     };
 };
 

