Ticket #4495: myth_guidespeed2_r15496.diff

File myth_guidespeed2_r15496.diff, 3.5 KB (added by Mark Buechler <Mark.Buechler@…>, 16 years ago)

The patch

  • libs/libmythtv/guidegrid.cpp

    diff -rup mythtv.orig/libs/libmythtv/guidegrid.cpp mythtv/libs/libmythtv/guidegrid.cpp
    old new uint GuideGrid::GetAlternateChannelIndex 
    638638        if (with_same_channum != same_channum)
    639639            continue;
    640640
    641         if (!ciinfo || !m_player->IsTunable(ciinfo->chanid))
     641        if (!ciinfo || !m_player->IsTunable(ciinfo->chanid, true))
    642642            continue;
    643643
    644644        if (with_same_channum ||
    bool GuideGrid::paintChannels(QPainter * 
    13351335
    13361336    PixmapChannel *chinfo = GetChannelInfo(m_currentStartChannel);
    13371337
     1338    if (m_player)
     1339        m_player->ClearTunableCache();
     1340
    13381341    bool showChannelIcon = gContext->GetNumSetting("EPGShowChannelIcon", 0);
    13391342
    13401343    for (unsigned int y = 0; (y < (unsigned int)DISPLAY_CHANS) && chinfo; y++)
    bool GuideGrid::paintChannels(QPainter * 
    13481351        chinfo = GetChannelInfo(chanNumber);
    13491352
    13501353        bool unavailable = false;
    1351         if (m_player && !m_player->IsTunable(chinfo->chanid))
     1354        if (m_player && !m_player->IsTunable(chinfo->chanid, true))
    13521355        {
    13531356            unavailable = true;
    13541357
  • libs/libmythtv/tv_play.cpp

    diff -rup mythtv.orig/libs/libmythtv/tv_play.cpp mythtv/libs/libmythtv/tv_play.cpp
    old new void TV::GetNextProgram(RemoteEncoder *e 
    55925592    infoMap["programid"]   = programid;
    55935593}
    55945594
    5595 bool TV::IsTunable(uint chanid)
     5595bool TV::IsTunable(uint chanid, bool use_cache)
    55965596{
    55975597    VERBOSE(VB_PLAYBACK, QString("IsTunable(%1)").arg(chanid));
    55985598
    bool TV::IsTunable(uint chanid) 
    56185618
    56195619    for (uint i = 0; i < cardids.size(); i++)
    56205620    {
    5621         vector<InputInfo> inputs =
    5622             RemoteRequestFreeInputList(cardids[i], excluded_cards);
     5621        vector<InputInfo> inputs;
     5622        if (!use_cache || !free_inputs.contains(cardids[i]))
     5623        {
     5624            inputs = RemoteRequestFreeInputList(cardids[i], excluded_cards);
     5625            free_inputs[cardids[i]] = inputs;
     5626        }
     5627        else
     5628            inputs = free_inputs[cardids[i]];
    56235629
    56245630#if 0
    56255631        cout << "inputs[" << cardids[i] << "]: ";
    bool TV::IsTunable(uint chanid) 
    56495655    return false;
    56505656}
    56515657
     5658void TV::ClearTunableCache(void)
     5659{
     5660    free_inputs.clear();
     5661}
     5662
    56525663void TV::EmbedOutput(WId wid, int x, int y, int w, int h)
    56535664{
    56545665    embedWinID = wid;
  • libs/libmythtv/tv_play.h

    diff -rup mythtv.orig/libs/libmythtv/tv_play.h mythtv/libs/libmythtv/tv_play.h
    old new  
    1919#include "programinfo.h"
    2020#include "channelutil.h"
    2121#include "videoouttypes.h"
     22#include "inputinfo.h"
    2223
    2324#include <qobject.h>
    2425
    class MPUBLIC TV : public QObject 
    138139    void EmbedOutput(WId wid, int x, int y, int w, int h);
    139140    void StopEmbeddingOutput(void);
    140141    bool IsEmbedding(void);
    141     bool IsTunable(uint chanid);
     142    bool IsTunable(uint chanid, bool use_cache=false);
     143    void ClearTunableCache(void);
    142144    void ChangeChannel(const DBChanList &options);
    143145
    144146    void DrawUnusedRects(bool sync);
    class MPUBLIC TV : public QObject 
    451453    bool    jumped_back; ///< Used by PromptDeleteRecording
    452454    vector<int> ff_rew_speeds;
    453455
     456    QMap< uint,vector<InputInfo> > free_inputs;
     457
    454458    uint    vbimode;
    455459
    456460    // State variables