On Sun, 2005-08-28 at 12:16 +0100, Allan Stirling wrote:
> Daniel Kristjansson wrote:
> > On Sun, 2005-08-28 at 00:21 +0100, Allan Stirling wrote:
> > 
> >>I only see this PSIP issue on one multiplex (Not sure if it's a specific 
> >>channel - For me, it's the first channel in my database - "mta-muslim 
> >>tv" which is FTA on Astra 28.2 (11662 H SR 27500 FEC 2/3))

> Is this good enough? It's two seperate startups, since a bad channel 
> tune seems to throw the frontend off enough that I can't change channel.
Can you try the attached patch.. If it doesn't solve your problem
please send me a log with "-v channel,record".

-- Daniel
Index: libs/libmythtv/mpeg/mpegstreamdata.cpp
===================================================================
--- libs/libmythtv/mpeg/mpegstreamdata.cpp	(revision 7159)
+++ libs/libmythtv/mpeg/mpegstreamdata.cpp	(working copy)
@@ -19,7 +19,7 @@
  *  \param cacheTables    If true PAT and PMT tables will be cached
  */
 MPEGStreamData::MPEGStreamData(int desiredProgram, bool cacheTables)
-    : QObject(NULL, "MPEGStreamData"),
+    : QObject(NULL, "MPEGStreamData"), _have_pmt_CRC_bug(false),
       _pat_version(-1), _cache_tables(cacheTables), _cache_lock(true),
       _cached_pat(NULL), _desired_program(desiredProgram),
       _pat_single_program(NULL), _pmt_single_program(NULL)
@@ -352,7 +352,8 @@
         return true;
 
     // Validate PSIP
-    if (!psip->IsGood())
+    bool validate = !_have_pmt_CRC_bug || (TableID::PMT != psip->TableID());
+    if (validate && !psip->IsGood())
     {
         VERBOSE(VB_RECORD, QString("PSIP packet failed CRC check. "
                                    "pid(0x%1) type(0x%2)")
Index: libs/libmythtv/mpeg/mpegstreamdata.h
===================================================================
--- libs/libmythtv/mpeg/mpegstreamdata.h	(revision 7159)
+++ libs/libmythtv/mpeg/mpegstreamdata.h	(working copy)
@@ -32,6 +32,7 @@
     virtual void Reset(int desiredProgram);
 
     // Table processing
+    void SetIgnoreCRCforPMT(bool pmtCRCbug) { _have_pmt_CRC_bug = pmtCRCbug; }
     virtual bool IsRedundant(const PSIPTable&) const;
     virtual bool HandleTables(uint pid, const PSIPTable &psip);
     virtual bool HandleTSTables(const TSPacket* tspacket);
@@ -132,6 +133,8 @@
     void CachePMT(uint pid, ProgramMapTable *pmt);
 
   protected:
+    bool                      _have_pmt_CRC_bug;
+
     // Listening
     QMap<uint, bool>          _pids_listening;
     QMap<uint, bool>          _pids_notlistening;
Index: libs/libmythtv/videosource.h
===================================================================
--- libs/libmythtv/videosource.h	(revision 7159)
+++ libs/libmythtv/videosource.h	(working copy)
@@ -68,6 +68,7 @@
     static DISEQC_TYPES GetDISEqCType(uint cardid);
 
     static CARD_TYPES   GetDVBType(uint device, QString &name, QString &card_type);
+    static bool         HasDVBCRCBug(uint device);
     static QString      GetDefaultInput(uint cardid);
 
     static bool         IgnoreEncrypted(uint cardid, const QString &inputname);
Index: libs/libmythtv/videosource.cpp
===================================================================
--- libs/libmythtv/videosource.cpp	(revision 7159)
+++ libs/libmythtv/videosource.cpp	(working copy)
@@ -110,6 +110,18 @@
     return nRet;
 }
 
+/** \fn CardUtil::HasDVBCRCBug(uint)
+ *  \brief Returns true iff the device munges PMT tables, so that they fail a CRC check.
+ *  \param [in]device video dev to be checked
+ *  \return true iff the device munges PMT tables, so that they fail a CRC check.
+ */
+bool CardUtil::HasDVBCRCBug(uint device)
+{
+    QString name(""), type("");
+    GetDVBType(device, name, type);
+    return (name == "VLSI VES1x93 DVB-S") || (name == "Philips TDA10046H DVB-T");
+}
+
 /** \fn CardUtil::GetCardType(uint, QString&, QString&)
  *  \brief Returns the card type from the video device
  *  \param [in]nVideoDev video dev to be checked
Index: libs/libmythtv/tv_rec.cpp
===================================================================
--- libs/libmythtv/tv_rec.cpp	(revision 7159)
+++ libs/libmythtv/tv_rec.cpp	(working copy)
@@ -1997,7 +1997,13 @@
 #endif //USING_V4L
     if (!sd)
         sd = new ATSCStreamData(-1, -1, true);
-        
+
+#ifdef USING_DVB    
+    DVBChannel *dvbc = dynamic_cast<DVBChannel*>(channel);
+    if (dvbc)
+        sd->SetIgnoreCRCforPMT(CardUtil::HasDVBCRCBug(dvbc->GetCardNum()));
+#endif //USING_DVB
+
     dtvSignalMonitor->SetStreamData(sd);
     sd->Reset(progNum);
 
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to