Index: libs/libmythtv/channelutil.h
===================================================================
--- libs/libmythtv/channelutil.h	(revision 9487)
+++ libs/libmythtv/channelutil.h	(working copy)
@@ -35,6 +35,7 @@
     static int     GetMplexID(int sourceid, uint freq);
     static int     GetMplexID(int sourceid, uint frequency,
                               int transport_id, int network_id);
+    static int     GetExistingMplexID(int transport_id, int network_id);
     static int     GetBetterMplexID(int current_mplexid,
                                     int transport_id, int network_id);
 
Index: libs/libmythtv/siscan.cpp
===================================================================
--- libs/libmythtv/siscan.cpp	(revision 9487)
+++ libs/libmythtv/siscan.cpp	(working copy)
@@ -1230,8 +1230,8 @@
     if (!sdt->ServiceCount())
         return;
 
-    int db_mplexid = ChannelUtil::GetBetterMplexID(
-        tid_db, sdt->TSID(), sdt->OriginalNetworkID());
+    int db_mplexid = ChannelUtil::GetExistingMplexID(sdt->TSID(),
+        sdt->OriginalNetworkID());
 
     if (db_mplexid == -1)
     {
@@ -1655,8 +1655,8 @@
     {
         MSqlQuery query(MSqlQuery::InitCon());
         // See if transport already in database
-        QString theQuery = QString("select * from dtv_multiplex where NetworkID = %1 and "
-                   " TransportID = %2 and Frequency = %3 and sourceID = %4")
+        QString theQuery = QString("SELECT * FROM dtv_multiplex WHERE networkid = %1 AND "
+                   " transportid = %2 AND frequency = %3 AND sourceid = %4")
                    .arg((*t).NetworkID)
                    .arg((*t).TransportID)
                    .arg((*t).Frequency)
Index: libs/libmythtv/channelutil.cpp
===================================================================
--- libs/libmythtv/channelutil.cpp	(revision 9487)
+++ libs/libmythtv/channelutil.cpp	(working copy)
@@ -303,6 +303,33 @@
     return -1;
 }
 
+int ChannelUtil::GetExistingMplexID(int transport_id, int network_id)
+{
+    MSqlQuery query(MSqlQuery::InitCon());
+    // See if transport already in database
+    query.prepare("SELECT mplexid FROM dtv_multiplex "
+                  "WHERE networkid=:NETWORKID AND transportid=:TRANSPORTID");
+
+    query.bindValue(":NETWORKID",   network_id);
+    query.bindValue(":TRANSPORTID", transport_id);
+
+    if (!query.exec() || !query.isActive())
+    {
+        MythContext::DBError("Selecting transports", query);
+        return -1;
+    }
+
+    if (query.size() > 0)
+    {
+        query.next();
+        VERBOSE(VB_SIPARSER,
+            QString("Matched existing MplexID"));
+        return query.value(0).toInt();
+    }
+
+    return -1;
+}
+
 /** \fn ChannelUtil::GetBetterMplexID(int, int, int)
  *  \brief Returns best match multiplex ID, creating one if needed.
  *
