Permalink
Browse files

ChannelScan: Update multiplex transponder and network id when channel…

… updated

When a transport is added manually using the transport editor, the transport
and network ids are not known and are left unset.  This causes a problem
for interactive TV which tunes a channel by network and transport id.

This patch updates the transport and network ids for a multiplex whenever a
channel is found or updated on the transport.

Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
Lawrence Rust authored and stuartm committed Jun 8, 2011
1 parent c722636 commit a32d5e31ad2833c6e55f3161732faa7fe2f00cfc
Showing with 28 additions and 3 deletions.
  1. +28 −3 mythtv/libs/libmythtv/channelscan/channelimporter.cpp
@@ -481,15 +481,28 @@ ScanDTVTransportList ChannelImporter::InsertChannels(
chan.channel_id = (chanid > 0) ? chanid : chan.channel_id;
- if (chan.channel_id && !chan.db_mplexid)
+ if (chan.channel_id)
{
uint tsid = chan.vct_tsid;
tsid = (tsid) ? tsid : chan.sdt_tsid;
tsid = (tsid) ? tsid : chan.pat_tsid;
tsid = (tsid) ? tsid : chan.vct_chan_tsid;
- chan.db_mplexid = ChannelUtil::CreateMultiplex(
- chan.source_id, transports[i], tsid, chan.orig_netid);
+ if (!chan.db_mplexid)
+ {
+ chan.db_mplexid = ChannelUtil::CreateMultiplex(
+ chan.source_id, transports[i], tsid, chan.orig_netid);
+ }
+ else
+ {
+ // Find the matching multiplex. This updates the
+ // transport and network ID's in case the transport
+ // was created manually
+ int id = ChannelUtil::GetBetterMplexID(chan.db_mplexid,
+ tsid, chan.orig_netid);
+ if (id >= 0)
+ chan.db_mplexid = id;
+ }
}
if (chan.channel_id && chan.db_mplexid)
@@ -638,6 +651,18 @@ ScanDTVTransportList ChannelImporter::UpdateChannels(
ChannelUtil::UpdateInsertInfoFromDB(chan);
+ // Find the matching multiplex. This updates the
+ // transport and network ID's in case the transport
+ // was created manually
+ uint tsid = chan.vct_tsid;
+ tsid = (tsid) ? tsid : chan.sdt_tsid;
+ tsid = (tsid) ? tsid : chan.pat_tsid;
+ tsid = (tsid) ? tsid : chan.vct_chan_tsid;
+ int id = ChannelUtil::GetBetterMplexID(chan.db_mplexid,
+ tsid, chan.orig_netid);
+ if (id >= 0)
+ chan.db_mplexid = id;
+
updated = ChannelUtil::UpdateChannel(
chan.db_mplexid,
chan.source_id,

0 comments on commit a32d5e3

Please sign in to comment.