Ticket #11020: 0001-Cache-FreeRecorderList-in-EPG.patch

File 0001-Cache-FreeRecorderList-in-EPG.patch, 3.7 KB (added by Shinck@…, 12 years ago)
  • mythtv/libs/libmythtv/tv_play.cpp

    From 91fc82efa40513a52002cd8ef5cb4d16f270ff03 Mon Sep 17 00:00:00 2001
    From: Sascha Hinck <SHinck@web.de>
    Date: Wed, 15 Aug 2012 05:08:05 +0200
    Subject: [PATCH] EPG: Cache FreeRecorderList query to remote Backend
    
    When the EPG during LiveTV shows up cache the result from the first query
    of GetFreeRecorderList to the backend in a local vector because it takes
    time and is repeated for each row and update of the guidegrid which is not
    acceptable e.g. for a windows remote frontend.
    ---
     mythtv/libs/libmythtv/tv_play.cpp          |   17 ++++++++++++++++-
     mythtv/libs/libmythtv/tv_play.h            |    1 +
     mythtv/programs/mythfrontend/guidegrid.cpp |    8 +++-----
     3 files changed, 20 insertions(+), 6 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index bbd10de..b039781 100644
    a b QSet<uint> TV::IsTunableOn( 
    78447844        excluded_cards.push_back(ctx->GetCardID());
    78457845
    78467846    uint sourceid = ChannelUtil::GetSourceIDForChannel(chanid);
    7847     vector<uint> connected   = RemoteRequestFreeRecorderList(excluded_cards);
     7847    vector<uint> connected;
     7848    if (use_cache)
     7849    {
     7850        QMutexLocker locker(&is_tunable_cache_lock);
     7851        if (is_tunable_cache_recorder.empty())
     7852            is_tunable_cache_recorder = RemoteRequestFreeRecorderList(excluded_cards);
     7853
     7854        connected = is_tunable_cache_recorder;
     7855    }
     7856    else
     7857        connected = RemoteRequestFreeRecorderList(excluded_cards);       
     7858   
    78487859    vector<uint> interesting = CardUtil::GetCardIDs(sourceid);
    78497860
    78507861    // filter disconnected cards
    void TV::ClearTunableCache(void) 
    79387952    QMutexLocker locker(&is_tunable_cache_lock);
    79397953    LOG(VB_CHANNEL, LOG_INFO, LOC + "ClearTunableCache()");
    79407954    is_tunable_cache_inputs.clear();
     7955    is_tunable_cache_recorder.clear();
    79417956}
    79427957
    79437958bool TV::StartEmbedding(const QRect &embedRect)
  • mythtv/libs/libmythtv/tv_play.h

    diff --git a/mythtv/libs/libmythtv/tv_play.h b/mythtv/libs/libmythtv/tv_play.h
    index d7b22ab..a1f806f 100644
    a b class MTV_PUBLIC TV : public QObject 
    777777    // IsTunable() cache, used by embedded program guide
    778778    mutable QMutex                 is_tunable_cache_lock;
    779779    QMap< uint,vector<InputInfo> > is_tunable_cache_inputs;
     780    vector<uint> is_tunable_cache_recorder;
    780781
    781782    // Channel group stuff
    782783    /// \brief Lock necessary when modifying channel group variables.
  • mythtv/programs/mythfrontend/guidegrid.cpp

    diff --git a/mythtv/programs/mythfrontend/guidegrid.cpp b/mythtv/programs/mythfrontend/guidegrid.cpp
    index de83c42..5106304 100644
    a b GuideGrid::GuideGrid(MythScreenStack *parent, 
    260260    m_currentStartTime = m_originalStartTime.addSecs(secsoffset);
    261261    m_startChanID  = chanid;
    262262    m_startChanNum = channum;
     263
     264    if (m_player)
     265        m_player->ClearTunableCache();
    263266}
    264267
    265268bool GuideGrid::Create()
    void GuideGrid::updateChannels(void) 
    15101513
    15111514    DBChannel *chinfo = GetChannelInfo(m_currentStartChannel);
    15121515
    1513     if (m_player)
    1514         m_player->ClearTunableCache();
    1515 
    15161516    for (unsigned int y = 0; (y < (unsigned int)m_channelCount) && chinfo; ++y)
    15171517    {
    15181518        unsigned int chanNumber = y + m_currentStartChannel;
    void GuideGrid::cursorDown() 
    18231823        fillProgramRowInfos(m_currentRow);
    18241824        m_guideGrid->SetRedraw();
    18251825        updateInfo();
    1826         updateChannels();
    18271826    }
    18281827}
    18291828
    void GuideGrid::cursorUp() 
    18411840        fillProgramRowInfos(m_currentRow);
    18421841        m_guideGrid->SetRedraw();
    18431842        updateInfo();
    1844         updateChannels();
    18451843    }
    18461844}
    18471845