Ticket #4339: 4339-dbg-v1.patch

File 4339-dbg-v1.patch, 7.4 KB (added by danielk, 16 years ago)

Possible fix + plenty of extra debugging if this doesn't do it..

  • libs/libmythtv/tv_play.h

     
    553553    // Channel changing timeout notification variables
    554554    QTime   lockTimer;
    555555    bool    lockTimerOn;
     556    QDateTime lastLockSeenTime;
    556557
    557558    // Previous channel functionality state variables
    558559    str_vec_t prevChan;       ///< Previous channels
  • libs/libmythtv/tv_play.cpp

     
    14661466        activerecorder = recorder;
    14671467        recorder->Setup();
    14681468       
     1469        VERBOSE(VB_IMPORTANT, "HandleStateChange(none,livetv): "
     1470                "lockTimer turned off");
     1471        QDateTime timerOffTime = QDateTime::currentDateTime();
    14691472        lockTimerOn = false;
    14701473
    14711474        SET_NEXT();
     
    15161519        }
    15171520        else
    15181521        {
    1519             lockTimer.start();
    1520             lockTimerOn = true;
     1522            if (!lastLockSeenTime.isValid() ||
     1523                (lastLockSeenTime < timerOffTime))
     1524            {
     1525                VERBOSE(VB_IMPORTANT, "HandleStateChange(none,livetv): "
     1526                        "lockTimer turned on");
     1527                lockTimer.start();
     1528                lockTimerOn = true;
     1529            }
     1530            else
     1531            {
     1532                VERBOSE(VB_IMPORTANT, "HandleStateChange(none,livetv): "
     1533                        "lockTimer NOT turned on, lock seen recently.");
     1534            }
    15211535        }
    15221536    }
    15231537    else if (TRANSITION(kState_WatchingLiveTV, kState_None))
     
    28522866                }
    28532867                else if (dialogname == "channel_timed_out")
    28542868                {
     2869                    VERBOSE(VB_IMPORTANT, "channel_timed_out: "
     2870                            "lockTimer turned off");
    28552871                    lockTimerOn = false;
    28562872                }
    28572873
     
    31763192                activerecorder->SetSignalMonitoringRate(rate,notify);
    31773193                UnpauseLiveTV();
    31783194
     3195                VERBOSE(VB_IMPORTANT, "SIGNALMON lockTimer turned off");
    31793196                lockTimerOn = false;
    31803197                sigMonMode  = !sigMonMode;
    31813198            }
     
    38253842    if (!pipnvp)
    38263843        return;
    38273844
     3845    VERBOSE(VB_IMPORTANT, "ToggleActiveWindow:: lockTimer turned on");
    38283846    lockTimerOn = false;
    38293847    if (activenvp == nvp)
    38303848    {
     
    38753893        }
    38763894    }
    38773895
     3896    VERBOSE(VB_IMPORTANT, "SwapPIP lockTimer turned off");
    38783897    lockTimerOn = false;
    38793898
    38803899    struct pip_info main, pip;
     
    44854504
    44864505        // now restart stuff
    44874506        lastSignalUIInfo.clear();
     4507        VERBOSE(VB_IMPORTANT, "SwitchCards lockTimer turned on");
    44884508        lockTimerOn = false;
    44894509
    44904510        activerecorder = recorder = testrec;
     
    45344554            activenvp = nvp;
    45354555            activerbuffer = prbuffer;
    45364556            lockTimer.start();
     4557            VERBOSE(VB_IMPORTANT, "SwitchCards lockTimer turned on");
    45374558            lockTimerOn = true;
    45384559        }
    45394560    }
     
    45934614    {
    45944615        // Pause the backend recorder, send command, and then unpause..
    45954616        PauseLiveTV();
     4617        VERBOSE(VB_IMPORTANT, "ToggleInputs() lockTimer turned off");
    45964618        lockTimerOn = false;
    45974619        inputname = activerecorder->SetInput(inputname);
    45984620        UnpauseLiveTV();
     
    52025224        GetOSD()->SetSettingsText(displayName, 3);
    52035225}
    52045226
     5227static QString to_comma_list(const QStringList &list)
     5228{
     5229    QString ret = "";
     5230    for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
     5231        ret += *it + ",";
     5232
     5233    if (ret.length())
     5234        return ret.left(ret.length()-1);
     5235
     5236    return "";
     5237}
     5238
    52055239/** \fn TV::UpdateOSDSignal(const QStringList&)
    52065240 *  \brief Updates Signal portion of OSD...
    52075241 */
    5208 void TV::UpdateOSDSignal(const QStringList& strlist)
     5242void TV::UpdateOSDSignal(const QStringList &strlist)
    52095243{
    52105244    QMutexLocker locker(&osdlock);
    52115245
     5246    VERBOSE(VB_IMPORTANT, "UpdateOSDSignal("<<to_comma_list(strlist)
     5247            <<") begin -- lockTimerOn: "<<lockTimerOn);
     5248
    52125249    if (!GetOSD() || browsemode || !queuedChanNum.isEmpty())
    52135250    {
    52145251        if (&lastSignalMsg != &strlist)
     5252        {
     5253            VERBOSE(VB_IMPORTANT, "UpdateOSDSignal() end "
     5254                    "-- set lastSignalMsg");
    52155255            lastSignalMsg = strlist;
     5256        }
    52165257        return;
    52175258    }
    52185259
     
    53415382
    53425383    // Turn off lock timer if we have an "All Good" or good PMT
    53435384    if (allGood || (pmt == "M"))
     5385    {
    53445386        lockTimerOn = false;
     5387        lastLockSeenTime = QDateTime::currentDateTime();
     5388    }
     5389
     5390    VERBOSE(VB_IMPORTANT, "UpdateOSDSignal() end -- lockTimerOn: "
     5391            <<lockTimerOn<<" allGood: "<<allGood
     5392            <<QString(" pmt: %1").arg(pmt));
    53455393}
    53465394
    53475395void TV::UpdateOSDTimeoutMessage(void)
    53485396{
     5397    //VERBOSE(VB_IMPORTANT, "UpdateOSDTimeoutMessage() begin -- lockTimerOn: "
     5398    //        <<lockTimerOn<<")");
     5399
    53495400    QString dlg_name("channel_timed_out");
    53505401    bool timed_out = false;
    53515402    if (activerecorder)
     
    53805431    static QString chan_up   = GET_KEY("TV Playback", "CHANNELUP");
    53815432    static QString chan_down = GET_KEY("TV Playback", "CHANNELDOWN");
    53825433    static QString next_src  = GET_KEY("TV Playback", "NEXTSOURCE");
    5383     static QString tog_cards = GET_KEY("TV Playback", "NEXTCARD");
     5434    static QString tog_cards = GET_KEY("TV Playback", "NEXTINPUT");
    53845435
    53855436    QString message = tr(
    53865437        "You should have gotten a channel lock by now. "
    53875438        "You can continue to wait for a signal, or you "
    53885439        "can change the channels with %1 or %2, change "
    5389         "video source (%3), change cards (%4), etc.")
     5440        "video source (%3), inputs (%4), etc.")
    53905441        .arg(chan_up).arg(chan_down).arg(next_src).arg(tog_cards);
    53915442
    53925443    QStringList options;
     
    62666317        }
    62676318        else if (message.left(6) == "SIGNAL")
    62686319        {
     6320            VERBOSE(VB_IMPORTANT, LOC + "Got: " + message);
    62696321            int cardnum = (QStringList::split(" ", message))[1].toInt();
    62706322            QStringList signalList = me->ExtraDataList();
    62716323            bool tc = activerecorder &&
    62726324                (activerecorder->GetRecorderNumber() == cardnum);
    62736325            if (tc && signalList.size())
    62746326            {
     6327                VERBOSE(VB_IMPORTANT, LOC + "Processed: " + message);
    62756328                UpdateOSDSignal(signalList);
    62766329            }
     6330            else
     6331            {
     6332                int ac_rec = -1;
     6333                if (activerecorder)
     6334                    ac_rec = activerecorder->GetRecorderNumber();
     6335                VERBOSE(VB_IMPORTANT, LOC + "Ignored: " + message
     6336                        <<"\n\t\t\tactiverec: "<<activerecorder
     6337                        <<" ac->rec: "<<ac_rec);
     6338            }
    62776339        }
    62786340        else if (recorder && message.left(7) == "SKIP_TO")
    62796341        {
     
    80098071void TV::PauseLiveTV(void)
    80108072{
    80118073    VERBOSE(VB_PLAYBACK, LOC + "PauseLiveTV()");
     8074
     8075    VERBOSE(VB_IMPORTANT, "PauseLiveTV() lockTimer turned off 1");
    80128076    lockTimerOn = false;
    80138077
    80148078    if (activenvp && activerbuffer)
     
    80278091    lastSignalUIInfo.clear();
    80288092    osdlock.unlock();
    80298093
     8094    VERBOSE(VB_IMPORTANT, "PauseLiveTV() lockTimer turned off 2");
    80308095    lockTimerOn = false;
    80318096
    80328097    QString input = activerecorder->GetInput();
     
    80358100    {
    80368101        lockTimer.start();
    80378102        lockTimerOn = true;
     8103        VERBOSE(VB_IMPORTANT, "PauseLiveTV() lockTimer turned on");
    80388104    }
    80398105}
    80408106