Index: libs/libmythtv/dvbconfparser.cpp
===================================================================
--- libs/libmythtv/dvbconfparser.cpp	(revision 8854)
+++ libs/libmythtv/dvbconfparser.cpp	(working copy)
@@ -156,6 +156,8 @@
     if (i == end || !c.modulation.parseConf(*i++)) return false;
     // We need the program number in the transport stream,
     // otherwise we cannot "tune" to the program.
+    if (i == end ) return false; else i++;   // Ignore video pid
+    if (i == end ) return false; else i++;   // Ignore audio pid
     if (i != end) c.serviceid = (*i++).toInt(); else return false;
 
     channels.append(c);
@@ -458,7 +460,9 @@
                   ":NAME,:MPLEXID,:SERVICEID);");
 
             query.bindValue(":CHANID",generateNewChanID(sourceid));
-            query.bindValue(":CHANNUM",(*iter).lcn==-1 ? (*iter).serviceid:(*iter).lcn);
+            // If the channel number is unknown, leave it at 0,
+            // possibly to be filled later by mythfilldatabase.
+            query.bindValue(":CHANNUM", (*iter).lcn==-1 ? 0 : (*iter).lcn);
             query.bindValue(":SOURCEID",sourceid);
             query.bindValue(":CALLSIGN",(*iter).name.utf8());
             query.bindValue(":NAME",(*iter).name.utf8());
Index: programs/mythfilldatabase/filldata.cpp
===================================================================
--- programs/mythfilldatabase/filldata.cpp	(revision 8854)
+++ programs/mythfilldatabase/filldata.cpp	(working copy)
@@ -842,8 +842,11 @@
             // First check if channel already in DB, but without xmltvid
             query.prepare("SELECT chanid FROM channel "
                           "WHERE sourceid = :SOURCEID AND "
-                          "      (channum=:CHANNUM OR atscsrcid=:ATSCSRCID)");
+                          "      (callsign = :CALLSIGN OR "
+                          "       channum = :CHANNUM OR "
+                          "       atscsrcid = :ATSCSRCID)");
             query.bindValue(":SOURCEID",  source.id);
+            query.bindValue(":CALLSIGN",  callsign);
             query.bindValue(":CHANNUM",   channum);
             query.bindValue(":ATSCSRCID", atscsrcid);
 
