Permalink
Browse files

Channel Scanner: Try harder to generate unique callsigns.

For some users of our channel scanner/some locales, we try to get the shortname from the SDT.  So far, so good.  Unfortunately, when this isn't available, the callsign can end up empty or non-unique, which messes up scheduling for some of those users.

Instead, generate a callsign based on the TSID and ServiceID, which should fairly reliably create unique callsigns.  They won't be the world's most informative callsigns, but scheduling and guide browsing should work as expected, which is important.
  • Loading branch information...
1 parent f37917f commit 9bb59804cd9bcf48c9428e1572dc72a8f518b178 Robert McNamara committed Jun 13, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
@@ -259,8 +259,8 @@ void ChannelScanSM::HandleAllGood(void)
{
int chanid = ChannelUtil::CreateChanID(sourceID, freqid);
- QString callsign = QString("%1%2")
- .arg(ChannelUtil::GetUnknownCallsign()).arg(freqid);
+ QString callsign = QString("%1-%2")
+ .arg(ChannelUtil::GetUnknownCallsign()).arg(chanid);
ok = ChannelUtil::CreateChannel(
0 /* mplexid */,
@@ -1021,7 +1021,9 @@ static void update_info(ChannelInsertInfo &info,
{
callsign = desc->ServiceShortName();
if (callsign.trimmed().isEmpty())
- callsign = QString::null;
+ callsign = QString("%1-%2-%3")
+ .arg(ChannelUtil::GetUnknownCallsign()).arg(sdt->TSID())
+ .arg(sdt->ServiceID(i));
service_name = desc->ServiceName();
if (service_name.trimmed().isEmpty())

0 comments on commit 9bb5980

Please sign in to comment.