Ticket #1847: inputs.2.diff

File inputs.2.diff, 2.1 KB (added by Mark.Buechler@…, 18 years ago)

The real patch..

  • libs/libmythtv/dvbchannel.h

     
    109109    int               cardnum;     ///< DVB Card number
    110110    bool              has_crc_bug; ///< true iff our driver munges PMT
    111111    int               nextInputID; ///< Signal an input change
     112    QString           nextInputName; ///< Contains name of the new input or null
    112113};
    113114
    114115#endif
  • libs/libmythtv/dvbchannel.cpp

     
    8989    bzero(&info, sizeof(info));
    9090    has_crc_bug = CardUtil::HasDVBCRCBug(aCardNum);
    9191    sigmon_delay = CardUtil::GetMinSignalMonitoringDelay(aCardNum);
     92
     93    nextInputName = QString::null;
    9294}
    9395
    9496DVBChannel::~DVBChannel()
     
    260262        return true;
    261263    }
    262264
     265    if (nextInputName.isNull())
     266    {
     267        QString inputName;
     268        if (!CheckChannel(chan, inputName))
     269        {
     270            VERBOSE(VB_IMPORTANT, LOC + "CheckChannel failed. " +
     271                    QString("Please verify channel '%1'").arg(chan) +
     272                    " in the \"mythtv-setup\" Channel Editor.");
     273            return false;
     274        }
     275
     276        // If CheckChannel filled in the inputName then we need to
     277        // change inputs and return, since the act of changing
     278        // inputs will change the channel as well.
     279        if (!inputName.isEmpty())
     280        {
     281            nextInputName = inputName;
     282            return ChannelBase::SwitchToInput(inputName, chan);
     283        }
     284    }
     285
    263286    if (GetChannelOptions(chan) == false)
    264287    {
    265288        VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to get channel options for " +
     
    285308            QString("channel '%1'.").arg(chan));
    286309
    287310    currentInputID = nextInputID;
     311    nextInputName = QString::null;
    288312    inputs[currentInputID]->startChanNum = curchannelname;
    289313
    290314    return true;