Ticket #11020: 0002-Cache-FreeRecorderList-in-EPG-026.patch

File 0002-Cache-FreeRecorderList-in-EPG-026.patch, 3.7 KB (added by Shinck@…, 12 years ago)

Patch for master / 0.26-rc

  • mythtv/libs/libmythtv/tv_play.cpp

    From 4083eb84989e4de7e6aa8d963c2f13a0f0976eeb Mon Sep 17 00:00:00 2001
    From: Sascha Hinck <SHinck@web.de>
    Date: Sat, 25 Aug 2012 18:24:48 +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          |   14 +++++++++++++-
     mythtv/libs/libmythtv/tv_play.h            |    1 +
     mythtv/programs/mythfrontend/guidegrid.cpp |    8 +++-----
     3 files changed, 17 insertions(+), 6 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
    index 89e27df..f087fd6 100644
    a b QSet<uint> TV::IsTunableOn( 
    79917991        excluded_cards.push_back(ctx->GetCardID());
    79927992
    79937993    uint sourceid = ChannelUtil::GetSourceIDForChannel(chanid);
    7994     vector<uint> connected   = RemoteRequestFreeRecorderList(excluded_cards);
     7994    vector<uint> connected;
     7995    if (use_cache)
     7996    {
     7997        QMutexLocker locker(&is_tunable_cache_lock);
     7998        if (is_tunable_cache_recorder.empty())
     7999            is_tunable_cache_recorder = RemoteRequestFreeRecorderList(excluded_cards);
     8000
     8001        connected = is_tunable_cache_recorder;
     8002    }
     8003    else
     8004        connected = RemoteRequestFreeRecorderList(excluded_cards);       
     8005   
    79958006    vector<uint> interesting = CardUtil::GetCardIDs(sourceid);
    79968007
    79978008    // filter disconnected cards
    void TV::ClearTunableCache(void) 
    80858096    QMutexLocker locker(&is_tunable_cache_lock);
    80868097    LOG(VB_CHANNEL, LOG_INFO, LOC + "ClearTunableCache()");
    80878098    is_tunable_cache_inputs.clear();
     8099    is_tunable_cache_recorder.clear();
    80888100}
    80898101
    80908102bool 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 7041f9f..d732cba 100644
    a b class MTV_PUBLIC TV : public QObject 
    811811    // IsTunable() cache, used by embedded program guide
    812812    mutable QMutex                 is_tunable_cache_lock;
    813813    QMap< uint,vector<InputInfo> > is_tunable_cache_inputs;
     814    vector<uint> is_tunable_cache_recorder;
    814815
    815816    // Channel group stuff
    816817    /// \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 1990c4e..0be4bba 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) 
    15111514
    15121515    DBChannel *chinfo = GetChannelInfo(m_currentStartChannel);
    15131516
    1514     if (m_player)
    1515         m_player->ClearTunableCache();
    1516 
    15171517    for (unsigned int y = 0; (y < (unsigned int)m_channelCount) && chinfo; ++y)
    15181518    {
    15191519        unsigned int chanNumber = y + m_currentStartChannel;
    void GuideGrid::cursorDown() 
    18241824        fillProgramRowInfos(m_currentRow);
    18251825        m_guideGrid->SetRedraw();
    18261826        updateInfo();
    1827         updateChannels();
    18281827    }
    18291828}
    18301829
    void GuideGrid::cursorUp() 
    18421841        fillProgramRowInfos(m_currentRow);
    18431842        m_guideGrid->SetRedraw();
    18441843        updateInfo();
    1845         updateChannels();
    18461844    }
    18471845}
    18481846