On Wed, 5 Oct 2005, Ian Caulfield wrote:

I've done some fiddling, and if I make the MPEGStreamData::IsRedundant call always return false, then it suddenly starts working for me... should it check program number as well as version number for PMT tables?

Here's a rough patch which seems to work for me...

Index: mpeg/mpegstreamdata.cpp
===================================================================
--- mpeg/mpegstreamdata.cpp     (revision 7389)
+++ mpeg/mpegstreamdata.cpp     (working copy)
@@ -282,7 +282,10 @@
         return (version == VersionPATSingleProgram());

     if (TableID::PMT == table_id)
-        return VersionPMT(psip.tsheader()->PID()) == version;
+    {
+        ProgramMapTable pmt(psip);
+ return VersionPMT(psip.tsheader()->PID(), pmt.ProgramNumber()) == version;
+    }

     return false;
 }
@@ -318,7 +321,8 @@
         }
         case TableID::PMT:
         {
-            SetVersionPMT(pid, psip.Version());
+            ProgramMapTable pmt(psip);
+            SetVersionPMT(pid, pmt.ProgramNumber(), psip.Version());
             if (_cache_tables)
             {
                 ProgramMapTable *pmt = new ProgramMapTable(psip);
Index: mpeg/mpegstreamdata.h
===================================================================
--- mpeg/mpegstreamdata.h       (revision 7389)
+++ mpeg/mpegstreamdata.h       (working copy)
@@ -21,6 +21,8 @@
 typedef vector<const ProgramMapTable*> pmt_vec_t;
 typedef QMap<uint, ProgramMapTable*>   pmt_cache_t;

+#define ENCODE_PID_PROG(pid, prog) (pid << 16 | (prog & 0xffff))
+
 class MPEGStreamData : public QObject
 {
     Q_OBJECT
@@ -62,8 +64,8 @@
     // Table versions
virtual void SetVersionPAT(int version) { _pat_version = version; } virtual int VersionPAT(void) const { return _pat_version; } - virtual void SetVersionPMT(uint pid, int ver) { _pmt_version[pid] = ver; }
-    virtual inline int VersionPMT(uint pid) const;
+ virtual void SetVersionPMT(uint pid, uint prog_num, int ver) { _pmt_version[ENCODE_PID_PROG(pid, prog_num)] = ver; }
+    virtual inline int VersionPMT(uint pid, uint prog_num) const;

     // Caching
     virtual bool HasCachedPAT(void) const;
@@ -199,9 +201,10 @@
     //AdaptationFieldControl afc(tspacket.data()+4);
 }

-inline int MPEGStreamData::VersionPMT(uint pid) const
+inline int MPEGStreamData::VersionPMT(uint pid, uint prog_num) const
 {
-    const QMap<uint, int>::const_iterator it = _pmt_version.find(pid);
+    const QMap<uint, int>::const_iterator it =
+            _pmt_version.find(ENCODE_PID_PROG(pid, prog_num));
     return (it == _pmt_version.end()) ? -1 : *it;
 }


_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to