Ticket #4963: external-changer.diff

File external-changer.diff, 3.4 KB (added by amb@…, 12 years ago)

Patch for external channel changer

  • mythtv-0.21/libs/libmythtv/channelbase.cpp

    old new  
    600600    return GetChannels(inputid);
    601601}
    602602
    603 bool ChannelBase::ChangeExternalChannel(const QString &channum)
     603bool ChannelBase::ChangeExternalChannel(const QString &freqid, const QString &channum)
    604604{
    605605#ifdef USING_MINGW
    606606    VERBOSE(VB_IMPORTANT, LOC_WARN +
     
    613613    if (changer.isEmpty())
    614614        return false;
    615615
    616     QString command = QString("%1 %2").arg(changer).arg(channum);
     616    QString command = QString("%1 %2 %3").arg(changer).arg(freqid).arg(channum);
    617617
    618618    VERBOSE(VB_CHANNEL, QString("External channel change: %1").arg(command));
    619619    pid_t child = fork();
    620 -- mythtv-0.21/libs/libmythtv/channel.cpp~      2008-03-15 14:42:42.000000000 +0000
     620++ mythtv-0.21/libs/libmythtv/channel.cpp       2008-03-15 14:51:00.000000000 +0000
     
    532532                return false;
    533533        }
    534534    }
    535     else if (!ChangeExternalChannel(freqid))
     535    else if (ChangeExternalChannel(freqid,channum))
     536      {
     537        if ((*it)->name.contains("television", false))
     538        {
     539            if (isFrequency)
     540            {
     541                if (!Tune(frequency, "", (is_dtv) ? "8vsb" : "analog", dtv_si_std))
     542                {
     543                    return false;
     544                }
     545            }
     546            else
     547            {
     548                if (!TuneTo(freqid, finetune))
     549                    return false;
     550            }
     551        }
     552      }
     553    else
    536554        return false;
    537555
    538556    // Set the current channum to the new channel's channum
    539 -- mythtv-0.21/libs/libmythtv/firewirechannel.cpp~      2008-01-16 17:55:48.000000000 +0000
     557++ mythtv-0.21/libs/libmythtv/firewirechannel.cpp       2008-03-15 13:55:28.000000000 +0000
     
    9595    bool ok = false;
    9696    if (!(*it)->externalChanger.isEmpty())
    9797    {
    98         ok = ChangeExternalChannel(freqid);
     98        ok = ChangeExternalChannel(freqid,channum);
    9999        SetSIStandard("mpeg");
    100100        SetDTVInfo(0,0,0,0,1);
    101101    }
  • mythtv-0.21/libs/libmythtv/channelbase.h

    old new  
    115115        int inputNum, uint &mplexid_restriction) const;
    116116
    117117    virtual int GetCardID(void) const;
    118     virtual bool ChangeExternalChannel(const QString &newchan);
     118    virtual bool ChangeExternalChannel(const QString &freqid, const QString &channum);
    119119    static void StoreInputChannels(const InputMap&);
    120120    static void StoreDefaultInput(uint cardid, const QString &input);
    121121
  • mythtv-0.21/libs/libmythtv/iptvchannel.cpp

    old new  
    107107        return false;
    108108    }
    109109
    110     if (!(*it)->externalChanger.isEmpty() && !ChangeExternalChannel(channum))
     110    if (!(*it)->externalChanger.isEmpty() && !ChangeExternalChannel(channum,"0"))
    111111        return false;
    112112
    113113    // Set the current channum to the new channel's channum
  • mythtv-0.21/libs/libmythtv/hdhrchannel.cpp

    old new  
    331331            return false;
    332332        }
    333333    }
    334     else if (!ChangeExternalChannel(freqid))
     334    else if (!ChangeExternalChannel(freqid,channum))
    335335        return false;
    336336
    337337    // Set the current channum to the new channel's channum