Ticket #5603: network_default_authority.patch

File network_default_authority.patch, 25.3 KB (added by David Waring <david.waring@…>, 16 years ago)

Patch for CRIDs without authorities and NIT default authorities

  • libs/libmythtv/channelutil.h

     
    6767        signed char trans_mode,
    6868        QString     inner_FEC,    QString     constellation,
    6969        signed char hierarchy,    QString     hp_code_rate,
    70         QString     lp_code_rate, QString     guard_interval);
     70        QString     lp_code_rate, QString     guard_interval,
     71        QString     default_authority );
    7172
    7273    static uint    CreateMultiplex(uint sourceid, const DTVMultiplex&,
    7374                                   int transport_id, int network_id);
    7475
    7576    static vector<uint> CreateMultiplexes(
    76         int sourceid, const NetworkInformationTable *nit);
     77        int sourceid, const NetworkInformationTable *nit,
     78        const QString& network_default_authority);
    7779
    7880    static uint    GetMplexID(uint sourceid, const QString &channum);
    7981    static int     GetMplexID(uint sourceid,     uint frequency);
  • libs/libmythtv/channelutil.cpp

     
    122122    signed char trans_mode,
    123123    QString     inner_FEC,     QString      constellation,
    124124    signed char hierarchy,     QString      hp_code_rate,
    125     QString     lp_code_rate,  QString      guard_interval)
     125    QString     lp_code_rate,  QString      guard_interval,
     126    QString     default_authority )
    126127{
    127128    MSqlQuery query(MSqlQuery::InitCon());
    128129
     
    166167        "lp_code_rate     = :LP_CODE_RATE, " : "";
    167168    updateStr += (!guard_interval.isNull()) ?
    168169        "guard_interval   = :GUARD_INTERVAL, " : "";
     170    updateStr += (!default_authority.isNull()) ?
     171        "default_authority = :DEFAULT_AUTHORITY, " : "";
    169172
    170173    updateStr = updateStr.left(updateStr.length()-2) + " ";
    171174
     
    181184        "INSERT INTO dtv_multiplex "
    182185        "  (sourceid,        sistandard,        frequency,  ";
    183186
    184     insertStr += (!modulation.isNull())     ? "modulation, "        : "";
    185     insertStr += (isDVB)                    ? "transportid, "       : "";
    186     insertStr += (isDVB)                    ? "networkid, "         : "";
    187     insertStr += (symbol_rate >= 0)         ? "symbolrate, "        : "";
    188     insertStr += (bandwidth   >= 0)         ? "bandwidth, "         : "";
    189     insertStr += (polarity    >= 0)         ? "polarity, "          : "";
    190     insertStr += (inversion   >= 0)         ? "inversion, "         : "";
    191     insertStr += (trans_mode  >= 0)         ? "transmission_mode, " : "";
    192     insertStr += (!inner_FEC.isNull())      ? "fec, "               : "";
    193     insertStr += (!constellation.isNull())  ? "constellation, "     : "";
    194     insertStr += (hierarchy  >= 0)          ? "hierarchy, "         : "";
    195     insertStr += (!hp_code_rate.isNull())   ? "hp_code_rate, "      : "";
    196     insertStr += (!lp_code_rate.isNull())   ? "lp_code_rate, "      : "";
    197     insertStr += (!guard_interval.isNull()) ? "guard_interval, "    : "";
     187    insertStr += (!modulation.isNull())        ? "modulation, "        : "";
     188    insertStr += (isDVB)                       ? "transportid, "       : "";
     189    insertStr += (isDVB)                       ? "networkid, "         : "";
     190    insertStr += (symbol_rate >= 0)            ? "symbolrate, "        : "";
     191    insertStr += (bandwidth   >= 0)            ? "bandwidth, "         : "";
     192    insertStr += (polarity    >= 0)            ? "polarity, "          : "";
     193    insertStr += (inversion   >= 0)            ? "inversion, "         : "";
     194    insertStr += (trans_mode  >= 0)            ? "transmission_mode, " : "";
     195    insertStr += (!inner_FEC.isNull())         ? "fec, "               : "";
     196    insertStr += (!constellation.isNull())     ? "constellation, "     : "";
     197    insertStr += (hierarchy  >= 0)             ? "hierarchy, "         : "";
     198    insertStr += (!hp_code_rate.isNull())      ? "hp_code_rate, "      : "";
     199    insertStr += (!lp_code_rate.isNull())      ? "lp_code_rate, "      : "";
     200    insertStr += (!guard_interval.isNull())    ? "guard_interval, "    : "";
     201    insertStr += (!default_authority.isNull()) ? "default_authority, " : "";
    198202    insertStr = insertStr.left(insertStr.length()-2) + ") ";
    199203
    200204    insertStr +=
    201205        "VALUES "
    202206        "  (:SOURCEID,       :SISTANDARD,       :FREQUENCY, ";
    203     insertStr += (!modulation.isNull())     ? ":MODULATION, "       : "";
    204     insertStr += (isDVB)                    ? ":TRANSPORTID, "      : "";
    205     insertStr += (isDVB)                    ? ":NETWORKID, "        : "";
    206     insertStr += (symbol_rate >= 0)         ? ":SYMBOLRATE, "       : "";
    207     insertStr += (bandwidth   >= 0)         ? ":BANDWIDTH, "        : "";
    208     insertStr += (polarity    >= 0)         ? ":POLARITY, "         : "";
    209     insertStr += (inversion   >= 0)         ? ":INVERSION, "        : "";
    210     insertStr += (trans_mode  >= 0)         ? ":TRANS_MODE, "       : "";
    211     insertStr += (!inner_FEC.isNull())      ? ":INNER_FEC, "        : "";
    212     insertStr += (!constellation.isNull())  ? ":CONSTELLATION, "    : "";
    213     insertStr += (hierarchy   >= 0)         ? ":HIERARCHY, "        : "";
    214     insertStr += (!hp_code_rate.isNull())   ? ":HP_CODE_RATE, "     : "";
    215     insertStr += (!lp_code_rate.isNull())   ? ":LP_CODE_RATE, "     : "";
    216     insertStr += (!guard_interval.isNull()) ? ":GUARD_INTERVAL, "   : "";
     207    insertStr += (!modulation.isNull())        ? ":MODULATION, "        : "";
     208    insertStr += (isDVB)                       ? ":TRANSPORTID, "       : "";
     209    insertStr += (isDVB)                       ? ":NETWORKID, "         : "";
     210    insertStr += (symbol_rate >= 0)            ? ":SYMBOLRATE, "        : "";
     211    insertStr += (bandwidth   >= 0)            ? ":BANDWIDTH, "         : "";
     212    insertStr += (polarity    >= 0)            ? ":POLARITY, "          : "";
     213    insertStr += (inversion   >= 0)            ? ":INVERSION, "         : "";
     214    insertStr += (trans_mode  >= 0)            ? ":TRANS_MODE, "        : "";
     215    insertStr += (!inner_FEC.isNull())         ? ":INNER_FEC, "         : "";
     216    insertStr += (!constellation.isNull())     ? ":CONSTELLATION, "     : "";
     217    insertStr += (hierarchy   >= 0)            ? ":HIERARCHY, "         : "";
     218    insertStr += (!hp_code_rate.isNull())      ? ":HP_CODE_RATE, "      : "";
     219    insertStr += (!lp_code_rate.isNull())      ? ":LP_CODE_RATE, "      : "";
     220    insertStr += (!guard_interval.isNull())    ? ":GUARD_INTERVAL, "    : "";
     221    insertStr += (!default_authority.isNull()) ? ":DEFAULT_AUTHORITY, " : "";
    217222    insertStr = insertStr.left(insertStr.length()-2) + ");";
    218223
    219224    query.prepare((mplex) ? updateStr : insertStr);
     
    255260        query.bindValue(":LP_CODE_RATE",  lp_code_rate);
    256261    if (!guard_interval.isNull())
    257262        query.bindValue(":GUARD_INTERVAL",guard_interval);
     263    if (!default_authority.isNull())
     264        query.bindValue(":DEFAULT_AUTHORITY",default_authority);
    258265
    259266    if (!query.exec() || !query.isActive())
    260267    {
     
    277284}
    278285
    279286void handle_transport_desc(vector<uint> &muxes, const MPEGDescriptor &desc,
    280                            uint sourceid, uint tsid, uint netid)
     287                           uint sourceid, uint tsid, uint netid,
     288                           const QString &default_authority)
    281289{
    282290    uint tag = desc.DescriptorTag();
    283291
     
    308316            cd.TransmissionModeString()[0].toAscii(),
    309317            QString(),                         cd.ConstellationString(),
    310318            cd.HierarchyString()[0].toAscii(), cd.CodeRateHPString(),
    311             cd.CodeRateLPString(),             cd.GuardIntervalString());
     319            cd.CodeRateLPString(),             cd.GuardIntervalString(),
     320            default_authority );
    312321
    313322        if (mux)
    314323            muxes.push_back(mux);
     
    335344            -1,
    336345            cd.FECInnerString(),  QString(),
    337346            -1,                   QString(),
    338             QString(),            QString());
     347            QString(),            QString(),
     348            default_authority );
    339349
    340350        if (mux)
    341351            muxes.push_back(mux);
     
    358368            -1,
    359369            cd.FECInnerString(),  QString::null,
    360370            -1,                   QString::null,
    361             QString::null,        QString::null);
     371            QString::null,        QString::null,
     372            default_authority );
    362373
    363374        if (mux)
    364375            muxes.push_back(mux);
     
    378389        -1,
    379390        QString::null,      QString::null,
    380391        -1,                 QString::null,
    381         QString::null,      QString::null);
     392        QString::null,      QString::null,
     393        QString::null );
    382394}
    383395
    384396uint ChannelUtil::CreateMultiplex(
     
    391403    signed char trans_mode,
    392404    QString     inner_FEC,    QString     constellation,
    393405    signed char hierarchy,    QString     hp_code_rate,
    394     QString     lp_code_rate, QString     guard_interval)
     406    QString     lp_code_rate, QString     guard_interval,
     407    QString     default_authority )
    395408{
    396409    return insert_dtv_multiplex(
    397410        sourceid,           sistandard,
     
    403416        trans_mode,
    404417        inner_FEC,          constellation,
    405418        hierarchy,          hp_code_rate,
    406         lp_code_rate,       guard_interval);
     419        lp_code_rate,       guard_interval,
     420        default_authority );
    407421}
    408422
    409423uint ChannelUtil::CreateMultiplex(uint sourceid, const DTVMultiplex &mux,
    410                                   int transport_id, int network_id)
     424                                  int transport_id, int network_id )
    411425{
    412426    return insert_dtv_multiplex(
    413427        sourceid,                         mux.sistandard,
     
    419433        mux.trans_mode.toChar().toAscii(),
    420434        mux.fec.toString(),               mux.modulation.toString(),
    421435        mux.hierarchy.toChar().toAscii(), mux.hp_code_rate.toString(),
    422         mux.lp_code_rate.toString(),      mux.guard_interval.toString());
     436        mux.lp_code_rate.toString(),      mux.guard_interval.toString(),
     437        mux.default_authority );
    423438}
    424439
    425440
     
    427442 *
    428443 */
    429444vector<uint> ChannelUtil::CreateMultiplexes(
    430     int sourceid, const NetworkInformationTable *nit)
     445    int sourceid, const NetworkInformationTable *nit,
     446    const QString& net_default_auth)
    431447{
    432448    vector<uint> muxes;
    433449
    434450    if (sourceid <= 0)
    435451        return muxes;
    436452
     453    // if there's a network level default authority use it, otherwise use
     454    //  passed in value.
     455    const desc_list_t& list =
     456        MPEGDescriptor::Parse(nit->NetworkDescriptors(),
     457                              nit->NetworkDescriptorsLength());
     458   
     459    const unsigned char* desc =
     460        MPEGDescriptor::Find(list, DescriptorID::default_authority);
     461
     462    QString network_default_authority(net_default_auth);
     463   
     464    if (desc)
     465    {
     466        network_default_authority
     467            = QString::fromAscii((const char*)desc+2, desc[1]);
     468    }
     469
    437470    for (uint i = 0; i < nit->TransportStreamCount(); ++i)
    438471    {
    439472        const desc_list_t& list =
    440473            MPEGDescriptor::Parse(nit->TransportDescriptors(i),
    441474                                  nit->TransportDescriptorsLength(i));
    442475
     476        const unsigned char* desc =
     477            MPEGDescriptor::Find(list, DescriptorID::default_authority);
     478   
     479        QString default_authority(network_default_authority);
     480   
     481        if (desc)
     482        {
     483            default_authority
     484                = QString::fromAscii((const char*)desc+2, desc[1]);
     485        }
     486
    443487        uint tsid  = nit->TSID(i);
    444488        uint netid = nit->OriginalNetworkID(i);
    445489        for (uint j = 0; j < list.size(); ++j)
    446490        {
    447491            const MPEGDescriptor desc(list[j]);
    448             handle_transport_desc(muxes, desc, sourceid, tsid, netid);
     492            handle_transport_desc(muxes, desc, sourceid, tsid, netid, default_authority);
    449493        }
    450494    }
    451495    return muxes;
  • libs/libmythtv/dbcheck.cpp

     
    1818#define MINIMUM_DBMS_VERSION 5,0,15
    1919
    2020/// This is the DB schema version expected by the running MythTV instance.
    21 const QString currentDatabaseVersion = "1222";
     21const QString currentDatabaseVersion = "1223";
    2222
    2323static bool UpdateDBVersionNumber(const QString &newnumber);
    2424static bool performActualUpdate(
     
    34453445NULL
    34463446};
    34473447        if (!performActualUpdate(updates, "1209", dbver))
    3448             return false;
     3448            return false;
    34493449    }
    34503450
    34513451    if (dbver == "1209")
     
    34663466NULL
    34673467};
    34683468        if (!performActualUpdate(updates, "1210", dbver))
    3469             return false;
     3469            return false;
    34703470    }
    34713471
    34723472    if (dbver == "1210")
     
    34883488NULL
    34893489};
    34903490        if (!performActualUpdate(updates, "1211", dbver))
    3491             return false;
     3491            return false;
    34923492    }
    34933493
    34943494    if (dbver == "1211")
     
    42874287            return false;
    42884288    }
    42894289
     4290    if (dbver == "1222")
     4291    {
     4292        const char *updates[] = {
     4293        // Content identfiers are authority (32) + data (29) + instance (3) = 64
     4294"ALTER TABLE program"
     4295"  MODIFY programid varchar(64) CHARACTER SET utf8 NOT NULL default '',"
     4296"  MODIFY seriesid varchar(64) CHARACTER SET utf8 NOT NULL default '';",
     4297        // tidy up content identifiers without authorities
     4298"UPDATE program SET programid = '' WHERE programid like '/%';",
     4299"UPDATE program SET seriesid = '' WHERE seriesid like '/%';",
     4300        // Add network level default authorities to the multiplex tables
     4301"ALTER TABLE dtv_multiplex ADD COLUMN"
     4302"    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",
     4303"ALTER TABLE channelscan_dtv_multiplex ADD COLUMN"
     4304"    default_authority varchar(32) CHARACTER SET utf8 NOT NULL default '';",
     4305NULL
     4306};
     4307        if (!performActualUpdate(updates, "1223", dbver))
     4308            return false;
     4309    }
    42904310
    42914311    return true;
    42924312}
  • libs/libmythtv/dtvmultiplex.h

     
    2121{
    2222  public:
    2323    DTVMultiplex()
    24         : frequency(0), symbolrate(0), mplex(0), sistandard(QString::null) { }
     24        : frequency(0), symbolrate(0), mplex(0), sistandard(QString::null)
     25        , default_authority(QString::null) { }
    2526    DTVMultiplex(const DTVMultiplex &other) { (*this) = other; }
    2627    DTVMultiplex &operator=(const DTVMultiplex &other);
    2728    virtual ~DTVMultiplex() { }
     
    7879    // Optional additional info
    7980    uint             mplex;
    8081    QString          sistandard;
     82    QString          default_authority;
    8183};
    8284
    8385class ScanDTVTransport : public DTVMultiplex
  • libs/libmythtv/dtvmultiplex.cpp

     
    1010
    1111DTVMultiplex &DTVMultiplex::operator=(const DTVMultiplex &other)
    1212{
    13     frequency      = other.frequency;
    14     symbolrate     = other.symbolrate;
    15     inversion      = other.inversion;
    16     bandwidth      = other.bandwidth;
    17     hp_code_rate   = other.hp_code_rate;
    18     lp_code_rate   = other.lp_code_rate;
    19     modulation     = other.modulation;
    20     trans_mode     = other.trans_mode;
    21     guard_interval = other.guard_interval;
    22     hierarchy      = other.hierarchy;
    23     polarity       = other.polarity;
    24     fec            = other.fec;
    25     mplex          = other.mplex;
    26     sistandard     = other.sistandard;
     13    frequency         = other.frequency;
     14    symbolrate        = other.symbolrate;
     15    inversion         = other.inversion;
     16    bandwidth         = other.bandwidth;
     17    hp_code_rate      = other.hp_code_rate;
     18    lp_code_rate      = other.lp_code_rate;
     19    modulation        = other.modulation;
     20    trans_mode        = other.trans_mode;
     21    guard_interval    = other.guard_interval;
     22    hierarchy         = other.hierarchy;
     23    polarity          = other.polarity;
     24    fec               = other.fec;
     25    mplex             = other.mplex;
     26    sistandard        = other.sistandard;
    2727    sistandard.detach();
     28    default_authority = other.default_authority;
     29    default_authority.detach();
    2830    return *this;
    2931}
    3032
     
    223225        "       fec,               polarity, "
    224226        "       hp_code_rate,      lp_code_rate,   constellation, "
    225227        "       transmission_mode, guard_interval, hierarchy, "
    226         "       modulation,        bandwidth,      sistandard "
     228        "       modulation,        bandwidth,      sistandard, "
     229        "       default_authority "
    227230        "FROM dtv_multiplex "
    228231        "WHERE dtv_multiplex.mplexid = :MPLEXID");
    229232    query.bindValue(":MPLEXID", mplexid);
     
    246249    mplex = mplexid;
    247250    sistandard = query.value(13).toString();
    248251    sistandard.detach();
     252    default_authority = query.value(14).toString();
     253    default_authority.detach();
    249254
    250255    // Parse the query into our DVBTuning class
    251256    return ParseTuningParams(
     
    319324        "    symbolrate,         fec,             polarity,   "
    320325        "    hp_code_rate,       lp_code_rate,    modulation, "
    321326        "    transmission_mode,  guard_interval,  hierarchy,  "
    322         "    bandwidth,          sistandard,      tuner_type  "
     327        "    bandwidth,          sistandard,      tuner_type, "
     328        "    default_authority "
    323329        " ) "
    324330        "VALUES "
    325331        " ( :SCANID, "
     
    328334        "   :HP_CODE_RATE,      :LP_CODE_RATE,   :MODULATION, "
    329335        "   :TRANSMISSION_MODE, :GUARD_INTERVAL, :HIERARCHY,  "
    330336        "   :BANDWIDTH,         :SISTANDARD,     :TUNER_TYPE  "
     337        "   :DEFAULT_AUTHORITY "
    331338        " );");
    332339
    333340    query.bindValue(":SCANID", scanid);
     
    346353    query.bindValue(":BANDWIDTH", bandwidth.toString());
    347354    query.bindValue(":SISTANDARD", sistandard);
    348355    query.bindValue(":TUNER_TYPE", (uint)tuner_type);
     356    query.bindValue(":DEFAULT_AUTHORITY", default_authority);
    349357
    350358    if (!query.exec())
    351359    {
  • libs/libmythtv/eit.cpp

     
    569569    return 1;
    570570}
    571571
    572 // If a series id or program id does not have an authority add the default.
     572/** \fn DBEvent::AddAuthority(const QString&, MSqlQuery &)
     573 *
     574 *  If a series id or program id is a CRID URI, just keep important info
     575 *  ID's are case insensitive, so lower case the whole id.
     576 *  If there is no authority on the ID, add the default one.
     577 *  If there is no default, return an empty id.
     578 *
     579 *  \param id The ID string to add the authority to.
     580 *  \param query Object to use for SQL queries.
     581 *
     582 *  \return ID with the authority added or empty string if not a valid CRID.
     583 */
    573584QString DBEvent::AddAuthority(const QString& id, MSqlQuery &query) const
    574585{
    575     if (id.length() == 0 || id[0] != '/')
     586    // if id is empty, return it.
     587    if (id.length() == 0)
    576588        return id;
    577589
     590    // CRIDs are not case sensitive, so change all to lower case
     591    QString crid = id.toLower();
     592
     593    // remove "crid://"
     594    if (crid.startsWith("crid://"))
     595        crid.remove(0,7);
     596
     597    // if id is a CRID with authority, return it
     598    if (crid[0] != '/')
     599        return crid;
     600
     601    // CRID without authority, so try to add the default channel authority
    578602    query.prepare("SELECT default_authority "
    579603        "FROM channel "
    580604        "WHERE chanid    = :CHANID");
     
    584608    if (!query.exec())
    585609    {
    586610        MythDB::DBError("AddAuthority", query);
    587         return id;
     611        return "";
    588612    }
    589613
    590614    if (query.next())
    591         return query.value(0).toString() + id;
    592     else
    593         return id;
     615    {
     616        const QString &authority = query.value(0).toString();
     617        if (authority.length()>0)
     618            return authority + crid;
     619    }
     620
     621    // No channel specific default authority, try a multiplex specific one
     622    query.prepare("SELECT m.default_authority "
     623                  "FROM channel c LEFT JOIN dtv_multiplex m "
     624                  "on (c.mplexid = m.mplexid) "
     625                  "WHERE c.chanid    = :CHANID");
     626   
     627    query.bindValue(":CHANID",      chanid);
     628   
     629    if (!query.exec())
     630    {
     631        MythDB::DBError("AddAuthority", query);
     632        return "";
     633    }
     634   
     635    if (query.next())
     636    {
     637        const QString &authority = query.value(0).toString();
     638        if (authority.length()>0)
     639            return authority + crid;
     640    }
     641
     642    return ""; // no authority, not a valid CRID, return empty
    594643}
  • libs/libmythtv/siscan.h

     
    208208    QTime             timer;
    209209
    210210    // Transports List
     211    uint                        lastNITVersion;
     212    QString                     networkDefaultAuthority;
    211213    int                         transportsScanned;
    212214    transport_scan_items_t      scanTransports;
    213215    transport_scan_items_it_t   current;
    214216    transport_scan_items_it_t   nextIt;
    215217    QMap<uint, uint>            dvbChanNums;
     218    QMap<uint, QString>         defaultAuthorities;
    216219
    217220    /// Scanner thread, runs SIScan::StartScanner()
    218221    pthread_t        scanner_thread;
  • libs/libmythtv/siscan.cpp

     
    105105      threadExit(false),
    106106      waitingForTables(false),
    107107      // Transports List
     108      lastNITVersion(65535),
     109      networkDefaultAuthority(),
    108110      transportsScanned(0),
    109111      // Misc
    110112      scanner_thread_running(false)
     
    322324            .arg((*current).FriendlyName));
    323325    VERBOSE(VB_SIPARSER, LOC + nit->toString());
    324326
    325     dvbChanNums.clear();
     327    // Clear channel numbers and default authorities if new NIT
     328    if (nit->Version() != lastNITVersion)
     329    {
     330        defaultAuthorities.clear();
     331        dvbChanNums.clear();
     332        networkDefaultAuthority.clear();
     333        lastNITVersion = nit->Version();
     334    }
    326335
    327336    if (nit->TransportStreamCount())
    328337    {
    329338        emit TransportScanUpdateText(
    330339            tr("Network %1 Processing").arg(nit->NetworkName()));
    331340
     341        const desc_list_t& list =
     342            MPEGDescriptor::Parse(nit->NetworkDescriptors(),
     343                                  nit->NetworkDescriptorsLength());
     344
     345        const unsigned char* desc =
     346            MPEGDescriptor::Find(list, DescriptorID::default_authority);
     347       
     348        if (desc)
     349        {
     350            networkDefaultAuthority
     351                = QString::fromAscii((const char*)desc+2, desc[1]);
     352        }
     353
    332354        vector<uint> mp;
    333         mp = ChannelUtil::CreateMultiplexes(sourceID, nit);
     355        mp = ChannelUtil::CreateMultiplexes(sourceID, nit,
     356                                            networkDefaultAuthority);
    334357        VERBOSE(VB_SIPARSER, QString("Created %1 multiplexes from NIT")
    335358                .arg(mp.size()));
    336359
    337360        // Get channel numbers from UK Frequency List Descriptors
     361        // Get mux specific default authorities
    338362        for (uint i = 0; i < nit->TransportStreamCount(); i++)
    339363        {
    340364            const desc_list_t& list =
    341365                MPEGDescriptor::Parse(nit->TransportDescriptors(i),
    342366                                      nit->TransportDescriptorsLength(i));
    343367
    344             const unsigned char* desc =
     368            desc =
    345369                MPEGDescriptor::Find(list, DescriptorID::dvb_uk_channel_list);
    346370
    347371            if (desc)
     
    350374                for (uint j = 0; j < uklist.ChannelCount(); j++)
    351375                    dvbChanNums[uklist.ServiceID(j)] = uklist.ChannelNumber(j);
    352376            }
     377
     378            desc =
     379                MPEGDescriptor::Find(list, DescriptorID::default_authority);
     380
     381            defaultAuthorities[nit->TSID(i)] = (desc)?
     382                QString::fromAscii((const char*)desc+2, desc[1]):
     383                networkDefaultAuthority;
    353384        }
    354385    }
    355386
     
    361392        emit TransportScanComplete();
    362393    }
    363394
    364     HandleDVBDBInsertion(GetDTVSignalMonitor()->GetScanStreamData(), true);
     395    HandleDVBDBInsertion(sd, true);
    365396}
    366397
    367398void SIScan::HandleMPEGDBInsertion(const ScanStreamData *sd, bool)
     
    16161647
    16171648        tuning.frequency = FindBestMplexFreq(
    16181649            tuning.frequency, transport, (*transport).SourceID, tsid, netid);
     1650        tuning.default_authority = defaultAuthorities[tsid];
    16191651    }
    16201652#endif // USING_DVB
    16211653
  • bindings/perl/MythTV.pm

     
    712712                                                 dtv_multiplex.polarity          AS dtv_polarity,
    713713                                                 dtv_multiplex.serviceversion    AS dtv_serviceversion,
    714714                                                 dtv_multiplex.sistandard        AS dtv_sistandard,
     715                                                 dtv_multiplex.default_authority AS dtv_default_authority,
    715716                                                 dtv_multiplex.sourceid          AS dtv_sourceid,
    716717                                                 dtv_multiplex.symbolrate        AS dtv_symbolrate,
    717718                                                 dtv_multiplex.transmission_mode AS dtv_transmission_mode,