Ticket #4472: 4472-test-2.patch

File 4472-test-2.patch, 7.8 KB (added by danielk, 16 years ago)

2nd test patch

  • libs/libmythtv/firewirechannel.cpp

     
    2222    fw_opts(firewire_opts),
    2323    device(NULL),
    2424    current_channel(0),
    25     isopen(false)
     25    isopen(false),
     26    initialized(false)
    2627{
    2728    uint64_t guid = string_to_guid(videodevice);
    2829    uint subunitid = 0; // we only support first tuner on STB...
     
    4041    InitializeInputs();
    4142}
    4243
     44bool FirewireChannel::Init(QString &inputname, QString &startchannel)
     45{
     46    if (!initialized)
     47    {
     48        DTVChannel::Init(inputname, startchannel);
     49    }
     50    else
     51    {
     52        VERBOSE(VB_CHANNEL, QString("[RE]Init(%1,%2)")
     53                .arg(inputname).arg(startchannel));
     54    }
     55    initialized = true;
     56}
     57
    4358bool FirewireChannel::SetChannelByString(const QString &channum)
    4459{
    4560    QString loc = LOC + QString("SetChannelByString(%1)").arg(channum);
     
    209224
    210225bool FirewireChannel::SetChannelByNumber(int channel)
    211226{
     227    VERBOSE(VB_CHANNEL, QString("SetChannelByNumber(%1)").arg(channel));
    212228    current_channel = channel;
    213229
    214230    if (FirewireDevice::kAVCPowerOff == GetPowerState())
  • libs/libmythtv/firewiredevice.cpp

     
    144144bool FirewireDevice::SetChannel(const QString &panel_model,
    145145                                uint alt_method, uint channel)
    146146{
     147    VERBOSE(VB_CHANNEL, QString("SetChannel(model %1, alt %2, chan %3)")
     148            .arg(panel_model).arg(alt_method).arg(channel));
     149
    147150    QMutexLocker locker(&m_lock);
     151    VERBOSE(VB_CHANNEL, "SetChannel() -- locked");
    148152
    149153    if (!IsSTBSupported(panel_model))
    150154    {
     
    160164    digit[2] = (channel % 10);
    161165
    162166    if (m_subunitid >= kAVCSubunitIdExtended)
     167    {
     168        VERBOSE(VB_IMPORTANT, LOC_ERR +
     169                "SetChannel: Extended subunits are not supported.");
     170
    163171        return false;
     172    }
    164173
    165174    vector<uint8_t> cmd;
    166175    vector<uint8_t> ret;
  • libs/libmythtv/firewirerecorder.cpp

     
    175175        VERBOSE(VB_RECORD, LOC + "PauseAndWait("<<timeout<<") -- pause");
    176176        if (!paused)
    177177        {
     178            VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- stop");
    178179            StopStreaming();
     180            VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- stopped");
     181            VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- setting 'paused'");
    179182            paused = true;
     183            VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- 'paused' set");
    180184            pauseWait.wakeAll();
    181185            if (tvrec)
     186            {
     187                VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- rec paused");
    182188                tvrec->RecorderPaused();
     189            }
    183190        }
     191        VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- wait for unpause");
    184192        unpauseWait.wait(timeout);
     193        VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- unpaused or timeout");
    185194    }
    186195    if (!request_pause && paused)
    187196    {
    188197        VERBOSE(VB_RECORD, LOC + "PauseAndWait("<<timeout<<") -- unpause");
    189198        StartStreaming();
     199        VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- clearing 'paused'");
    190200        paused = false;
     201        VERBOSE(VB_RECORD, LOC + "PauseAndWait() -- 'paused' cleared");
    191202    }
     203
     204    VERBOSE(VB_RECORD, LOC + "PauseAndWait("<<timeout<<") -- done "
     205            "-- paused("<<paused<<")");
     206
    192207    return paused;
    193208}
    194209
  • libs/libmythtv/channelutil.cpp

     
    920920                                    const QString &new_channum,
    921921                                    const QString &old_channum)
    922922{
     923    VERBOSE(VB_CHANNEL, QString("IsOnSameMultiplex: old_channum: %1")
     924            .arg(old_channum));
     925    VERBOSE(VB_CHANNEL, QString("IsOnSameMultiplex: new_channum: %1")
     926            .arg(old_channum));
     927
    923928    if (new_channum.isEmpty() || old_channum.isEmpty())
    924929        return false;
    925930
    926     if (new_channum == old_channum)
    927         return true;
     931//    if (new_channum == old_channum)
     932//        return true;
    928933
    929934    uint old_mplexid = GetMplexID(srcid, old_channum);
    930935    if (!old_mplexid)
     
    934939    if (!new_mplexid)
    935940        return false;
    936941
     942    VERBOSE(VB_CHANNEL, QString("IsOnSameMultiplex? %1==%2 -> %3")
     943            .arg(old_mplexid).arg(new_mplexid)
     944            .arg(old_mplexid == new_mplexid));
     945
    937946    return old_mplexid == new_mplexid;
    938947}
    939948
  • libs/libmythtv/firewirechannel.h

     
    1919    ~FirewireChannel() { Close(); }
    2020
    2121    // Commands
     22    virtual bool Init(QString &inputname, QString &startchannel);
    2223    virtual bool Open(void);
    2324    virtual void Close(void);
    2425
     
    4546    FirewireDevice    *device;
    4647    uint               current_channel;
    4748    bool               isopen;
     49    bool               initialized;
    4850};
    4951
    5052#endif // _FIREWIRECHANNEL_H_
  • libs/libmythtv/tv_rec.cpp

     
    27952795 */
    27962796void TVRec::PauseRecorder(void)
    27972797{
     2798    VERBOSE(VB_IMPORTANT, "PauseRecorder -- begin");
    27982799    QMutexLocker lock(&stateChangeLock);
    27992800
    28002801    if (!recorder)
     
    28052806    }
    28062807
    28072808    recorder->Pause();
     2809    VERBOSE(VB_IMPORTANT, "PauseRecorder -- done "
     2810            "(still need to wait for pause)");
    28082811}
    28092812
    28102813/** \fn TVRec::RecorderPaused(void)
     
    30123015void TVRec::SetChannel(QString name, uint requestType)
    30133016{
    30143017    QMutexLocker lock(&stateChangeLock);
    3015     VERBOSE(VB_RECORD, LOC + "SetChannel()" + " -- begin");
     3018    VERBOSE(VB_RECORD, LOC + QString("SetChannel(%1) -- begin").arg(name));
    30163019
    30173020    // Detect tuning request type if needed
    30183021    if (requestType & kFlagDetect)
     
    30353038        while (!HasFlags(kFlagRingBufferReady))
    30363039            WaitForEventThreadSleep();
    30373040    }
    3038     VERBOSE(VB_RECORD, LOC + "SetChannel()" + " -- end");
     3041    VERBOSE(VB_RECORD, LOC + QString("SetChannel(%1) -- end").arg(name));
    30393042}
    30403043
    30413044/** \fn TVRec::GetNextProgram(int,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&,QString&)
     
    33353338
    33363339    uint    sourceid   = channel->GetCurrentSourceID();
    33373340    QString oldchannum = channel->GetCurrentName();
    3338     QString newchannum = request.channel;
     3341    QString newchannum = QDeepCopy<QString>(request.channel);
    33393342
    33403343    if (ChannelUtil::IsOnSameMultiplex(sourceid, newchannum, oldchannum))
    33413344    {
     
    34013404                             kFlagEITScan|kFlagAntennaAdjust))
    34023405        {
    34033406            if (!recorder)
     3407            {
     3408                VERBOSE(VB_RECORD, LOC +
     3409                        "No recorder yet, calling TuningFrequency");
    34043410                TuningFrequency(request);
     3411            }
    34053412            else
     3413            {
     3414                VERBOSE(VB_RECORD, LOC + "Waiting for recorder pause..");
    34063415                SetFlags(kFlagWaitingForRecPause);
     3416            }
    34073417        }
    34083418        lastTuningRequest = request;
    34093419    }
     
    34233433            GetHDHRRecorder()->SetRingBuffer(NULL);
    34243434        }
    34253435#endif // USING_HDHOMERUN
     3436        VERBOSE(VB_RECORD, LOC + "Recorder paused, calling TuningFrequency");
    34263437        TuningFrequency(lastTuningRequest);
    34273438    }
    34283439