Ticket #1485: getbettermplex.patch
File getbettermplex.patch, 2.8 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/channelutil.h
35 35 static int GetMplexID(int sourceid, uint freq); 36 36 static int GetMplexID(int sourceid, uint frequency, 37 37 int transport_id, int network_id); 38 static int GetExistingMplexID(int transport_id, int network_id); 38 39 static int GetBetterMplexID(int current_mplexid, 39 40 int transport_id, int network_id); 40 41 -
libs/libmythtv/siscan.cpp
1230 1230 if (!sdt->ServiceCount()) 1231 1231 return; 1232 1232 1233 int db_mplexid = ChannelUtil::Get BetterMplexID(1234 tid_db, sdt->TSID(),sdt->OriginalNetworkID());1233 int db_mplexid = ChannelUtil::GetExistingMplexID(sdt->TSID(), 1234 sdt->OriginalNetworkID()); 1235 1235 1236 1236 if (db_mplexid == -1) 1237 1237 { … … 1655 1655 { 1656 1656 MSqlQuery query(MSqlQuery::InitCon()); 1657 1657 // See if transport already in database 1658 QString theQuery = QString(" select * from dtv_multiplex where NetworkID = %1 and"1659 " TransportID = %2 and Frequency = %3 and sourceID= %4")1658 QString theQuery = QString("SELECT * FROM dtv_multiplex WHERE networkid = %1 AND " 1659 " transportid = %2 AND frequency = %3 AND sourceid = %4") 1660 1660 .arg((*t).NetworkID) 1661 1661 .arg((*t).TransportID) 1662 1662 .arg((*t).Frequency) -
libs/libmythtv/channelutil.cpp
303 303 return -1; 304 304 } 305 305 306 int ChannelUtil::GetExistingMplexID(int transport_id, int network_id) 307 { 308 MSqlQuery query(MSqlQuery::InitCon()); 309 // See if transport already in database 310 query.prepare("SELECT mplexid FROM dtv_multiplex " 311 "WHERE networkid=:NETWORKID AND transportid=:TRANSPORTID"); 312 313 query.bindValue(":NETWORKID", network_id); 314 query.bindValue(":TRANSPORTID", transport_id); 315 316 if (!query.exec() || !query.isActive()) 317 { 318 MythContext::DBError("Selecting transports", query); 319 return -1; 320 } 321 322 if (query.size() > 0) 323 { 324 query.next(); 325 VERBOSE(VB_SIPARSER, 326 QString("Matched existing MplexID")); 327 return query.value(0).toInt(); 328 } 329 330 return -1; 331 } 332 306 333 /** \fn ChannelUtil::GetBetterMplexID(int, int, int) 307 334 * \brief Returns best match multiplex ID, creating one if needed. 308 335 *