Ticket #2646: iptvchannel.diff

File iptvchannel.diff, 1.2 KB (added by stefan.horst@…, 19 years ago)

patch for iptvchannel to support multiple streams in header

  • libs/libmythtv/iptvchannel.cpp

     
    131131
    132132    // Set the channel..
    133133    curchannelname = channum;
    134     currentProgramNum = 1;
    135134
     135    InputMap::const_iterator it = inputs.find(currentInputID);
     136    if (it == inputs.end())
     137    {
     138        VERBOSE(VB_IMPORTANT, QString("error input not found:"));
     139        return false;
     140    }
     141    int sourceid = (*it)->sourceid;
     142
     143    MSqlQuery query(MSqlQuery::InitCon());
     144    query.prepare(
     145        "SELECT serviceid "
     146        "FROM channel "
     147        "WHERE channum  = :CHANNUM AND "
     148        "      sourceid = :SOURCEID");
     149
     150    query.bindValue(":CHANNUM",  channum);
     151    query.bindValue(":SOURCEID", sourceid);
     152
     153    if (!query.exec() || !query.isActive())
     154    {
     155        MythContext::DBError("fetching chaninfo", query);
     156        VERBOSE(VB_IMPORTANT, QString("error in DB:"));
     157        return false;
     158    }
     159
     160    while (query.next())
     161    {
     162        currentProgramNum = query.value(0).toUInt();
     163    }
     164
    136165    VERBOSE(VB_CHANNEL, LOC + "SetChannelByString() -- end");
    137166    return true;
    138167}