diff --git a/mythtv/libs/libmythtv/iptvsignalmonitor.cpp b/mythtv/libs/libmythtv/iptvsignalmonitor.cpp
index 04871d5..68f507c 100644
--- a/mythtv/libs/libmythtv/iptvsignalmonitor.cpp
+++ b/mythtv/libs/libmythtv/iptvsignalmonitor.cpp
@@ -22,6 +22,8 @@ void IPTVTableMonitorThread::run(void)
     RunEpilog();
 }
 
+const uint IPTVSignalMonitor::kStreamTypeDetectionMinSize = 128*1024;
+
 /** \fn IPTVSignalMonitor::IPTVSignalMonitor(int,IPTVChannel*,uint64_t)
  *  \brief Initializes signal lock and signal values.
  *
@@ -49,6 +51,8 @@ IPTVSignalMonitor::IPTVSignalMonitor(int db_cardnum,
         isLocked = GetChannel()->GetFeeder()->Open(chaninfo.m_url);
     }
 
+    streamTypeDetectionBuffer.reserve(kStreamTypeDetectionMinSize + 64 * 1024);
+
     QMutexLocker locker(&statusLock);
     signalLock.SetValue((isLocked) ? 1 : 0);
     signalStrength.SetValue((isLocked) ? 100 : 0);
@@ -106,10 +110,101 @@ void IPTVSignalMonitor::RunTableMonitor(void)
     DBG_SM("Run", "end");
 }
 
+/// This tries to find TS sync bytes at 188, 204,and 208 byte intervals.
+/// If it finds them it returns kStreamTypeTS otherwise it returns
+/// kStreamTypePES. Ideally we'd really detect PES streams and return
+/// kStreamTypeUnknown if it isn't a PES stream either, but this is
+/// a start.
+static IPTVSignalMonitor::StreamType detect_stream_type(
+    const vector<unsigned char> &data)
+{
+    IPTVSignalMonitor::StreamType st = IPTVSignalMonitor::kStreamTypePES;
+
+    QList<uint> sync_locations;
+    for (uint i = 0; i < data.size(); i++)
+    {
+        if (SYNC_BYTE == data[i])
+            sync_locations.push_back(i);
+    }
+
+    if (sync_locations.empty())
+        return st;
+
+    QMap<uint, uint> counts;
+
+    QSet<uint> sizes;
+    sizes.insert(sizeof(TSPacket));
+    sizes.insert(sizeof(TSDVBEmissionPacket));
+    sizes.insert(sizeof(TSISDBEmissionPacket));
+    sizes.insert(sizeof(TS8VSBEmissionPacket));
+
+    QSet<uint>::const_iterator sit = sizes.begin();
+    for (; sit != sizes.end(); ++sit)
+    {
+        uint count = 0;
+        uint last_loc = sync_locations[0];
+        for (uint i = 1; i < data.size(); i++)
+        {
+            uint next = i + 1;
+            for (uint j = i; j < data.size() && data[j] <= last_loc + *sit; j++)
+            {
+                if (data[j] == last_loc + *sit)
+                {
+                    count++;
+                    next = j;
+                    break;
+                }
+            }
+        }
+        counts[*sit] = count;
+    }
+
+    for (sit = sizes.begin(); sit != sizes.end(); ++sit)
+    {
+        int expected = (data.size() / *sit) - 1;
+        LOG(VB_GENERAL, LOG_INFO, QString("Count for %1 was %2, expected %3")
+            .arg(*sit).arg(counts[*sit]).arg(expected));
+        if ((counts[*sit] >= 1) && (expected >= 1) &&
+            (counts[*sit] >= (expected * 0.8f)))
+        {
+            st = IPTVSignalMonitor::kStreamTypeTS;
+        }
+    }
+
+    return st;
+}
+
 void IPTVSignalMonitor::AddData(
     const unsigned char *data, unsigned int dataSize)
 {
+    LOG(VB_GENERAL, LOG_INFO, LOC + QString("AddData(...%1)").arg(dataSize));
     GetStreamData()->ProcessData((unsigned char*)data, dataSize);
+    if (kStreamTypeUnknown != streamType)
+        return;
+
+    if (streamTypeDetectionBuffer.size() < kStreamTypeDetectionMinSize)
+    {
+        uint old_size = streamTypeDetectionBuffer.size();
+        streamTypeDetectionBuffer.resize(old_size + dataSize);
+        memcpy(&streamTypeDetectionBuffer[old_size], data, dataSize);
+    }
+
+    if (streamTypeDetectionBuffer.size() >= kStreamTypeDetectionMinSize)
+    {
+        streamType = detect_stream_type(streamTypeDetectionBuffer);
+        streamTypeDetectionBuffer.clear();
+        LOG(VB_GENERAL, LOG_INFO, LOC + QString("AddData(...%1) st %2")
+            .arg(dataSize).arg(streamType));
+    }
+
+    if (kStreamTypePES == streamType)
+    {
+        QMutexLocker locker(&statusLock);
+        RemoveFlags(kDTVSigMon_WaitForPAT | kDTVSigMon_WaitForPMT |
+                    kDTVSigMon_WaitForMGT | kDTVSigMon_WaitForVCT |
+                    kDTVSigMon_WaitForNIT | kDTVSigMon_WaitForSDT |
+                    kDTVSigMon_WaitForCrypt);
+    }
 }
 
 /** \fn IPTVSignalMonitor::UpdateValues(void)
diff --git a/mythtv/libs/libmythtv/iptvsignalmonitor.h b/mythtv/libs/libmythtv/iptvsignalmonitor.h
index eae3d1d..8e137a7 100644
--- a/mythtv/libs/libmythtv/iptvsignalmonitor.h
+++ b/mythtv/libs/libmythtv/iptvsignalmonitor.h
@@ -33,6 +33,13 @@ class IPTVSignalMonitor : public DTVSignalMonitor, public TSDataListener
     // implements TSDataListener
     void AddData(const unsigned char *data, unsigned int dataSize);
 
+    typedef enum StreamType
+    {
+        kStreamTypeUnknown,
+        kStreamTypePES,
+        kStreamTypeTS,
+    } StreamType;
+
   protected:
     IPTVSignalMonitor(void);
     IPTVSignalMonitor(const IPTVSignalMonitor&);
@@ -46,6 +53,10 @@ class IPTVSignalMonitor : public DTVSignalMonitor, public TSDataListener
   protected:
     volatile bool dtvMonitorRunning;
     IPTVTableMonitorThread *tableMonitorThread;
+
+    StreamType streamType;
+    static const uint kStreamTypeDetectionMinSize;
+    vector<unsigned char> streamTypeDetectionBuffer;
 };
 
 #endif // _IPTVSIGNALMONITOR_H_
