Skip to content

Commit

Permalink
Use transport id as service id in MPTS channels
Browse files Browse the repository at this point in the history
In mythtv-setup, it is possible to create MPTS channels that
can record the complete transport stream without any pid filtering.
In the channel list, the service ID is used as channel number when
there is no logical channel number information present.
For the MPTS channels, who do not have a service id,  this means
that the channel number must always be entered manually, both on
an initial scan and on a rescan.
This fix uses the transport stream ID as the service ID; the default
channel number of the MPTS channels is then the transport stream ID.

N.B. It is possible that the transport stream id does conflict
with either a logical channel number or a service id but when that
happens the channel number conflict resultion dialogs are still there.
  • Loading branch information
kmdewaal committed May 5, 2019
1 parent aaaa740 commit a203d41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
Expand Up @@ -1523,6 +1523,10 @@ ScanDTVTransportList ChannelScanSM::GetChannelList(bool addFullTS) const
dbchan_it = pnum_to_dbchan.begin();
ChannelInsertInfo info = *dbchan_it;

// Use transport stream ID as (fake) service ID
// to use in callsign and as channel number
info.m_service_id = info.m_pat_tsid;

if (tuner_type == DTVTunerType::kTunerTypeASI)
info.m_callsign = QString("MPTS_%1")
.arg(CardUtil::GetDisplayName(cardid));
Expand All @@ -1533,8 +1537,6 @@ ScanDTVTransportList ChannelScanSM::GetChannelList(bool addFullTS) const
else if (info.m_atsc_major_channel > 0)
info.m_callsign =
QString("MPTS_%1").arg(info.m_atsc_major_channel);
else if (info.m_pat_tsid > 0)
info.m_callsign = QString("MPTS_%1").arg(info.m_pat_tsid);
else if (info.m_service_id > 0)
info.m_callsign = QString("MPTS_%1").arg(info.m_service_id);
else if (!info.m_chan_num.isEmpty())
Expand All @@ -1543,9 +1545,9 @@ ScanDTVTransportList ChannelScanSM::GetChannelList(bool addFullTS) const
info.m_callsign = "MPTS_UNKNOWN";

info.m_service_name = info.m_callsign;
info.m_service_id = 0;
info.m_atsc_minor_channel = 0;
info.m_format = "MPTS";
info.m_use_on_air_guide = false;
item.m_channels.push_back(info);
}

Expand Down

0 comments on commit a203d41

Please sign in to comment.