Ticket #8387: libmythtv.2.patch

File libmythtv.2.patch, 6.4 KB (added by jafa@…, 14 years ago)

do not set hardware program filter - causes problems with multirec. Replaces previous libmythtv patch file

  • tv_play.h

     
    402402    QString GetQueuedChanNum(void) const;
    403403    uint    GetQueuedChanID(void)  const { return queuedChanID; }
    404404
    405     void SwitchSource(uint source_direction);
     405    void SwitchSource(PlayerContext*, uint source_direction);
    406406    void SwitchInputs(PlayerContext*, uint inputid);
    407407    void ToggleInputs(PlayerContext*, uint inputid = 0);
    408408    void SwitchCards(PlayerContext*,
  • hdhrstreamhandler.cpp

     
    483483
    484484bool HDHRStreamHandler::UpdateFilters(void)
    485485{
     486    if (_tune_mode == hdhrTuneModeFrequency)
     487        _tune_mode = hdhrTuneModeFrequencyPid;
     488
     489    if (_tune_mode != hdhrTuneModeFrequencyPid)
     490    {
     491        VERBOSE(VB_IMPORTANT, LOC_ERR + "UpdateFilters called in wrong tune mode");
     492        return false;
     493    }
     494
    486495#ifdef DEBUG_PID_FILTERS
    487496    VERBOSE(VB_RECORD, LOC + "UpdateFilters()");
    488497#endif // DEBUG_PID_FILTERS
     
    493502    vector<uint> range_min;
    494503    vector<uint> range_max;
    495504
    496 // FIXME
    497 //    if (_ignore_filters)
    498  //       return true;
    499 
    500505    for (uint i = 0; i < _pid_info.size(); i++)
    501506    {
    502507        uint pid_min = _pid_info[i];
     
    731736
    732737bool HDHRStreamHandler::TuneChannel(const QString &chn)
    733738{
     739    _tune_mode = hdhrTuneModeFrequency;
     740
    734741    QString current = TunerGet("channel");
    735 
    736742    if (current == chn)
    737743    {
    738744        VERBOSE(VB_RECORD, QString(LOC + "Not Re-Tuning channel %1").arg(chn));
     
    746752
    747753bool HDHRStreamHandler::TuneProgram(uint mpeg_prog_num)
    748754{
     755    if (_tune_mode == hdhrTuneModeFrequency)
     756        _tune_mode = hdhrTuneModeFrequencyProgram;
     757
     758    if (_tune_mode != hdhrTuneModeFrequencyProgram)
     759    {
     760        VERBOSE(VB_IMPORTANT, LOC_ERR + "TuneProgram called in wrong tune mode");
     761        return false;
     762    }
     763
    749764    VERBOSE(VB_RECORD, QString(LOC + "Tuning program %1").arg(mpeg_prog_num));
    750765    return !TunerSet(
    751766        "program", QString::number(mpeg_prog_num), false).isEmpty();
    752767}
     768
     769bool HDHRStreamHandler::TuneVChannel(const QString &vchn)
     770{
     771    _tune_mode = hdhrTuneModeVChannel;
     772
     773    VERBOSE(VB_RECORD, QString(LOC + "Tuning vchannel %1").arg(vchn));
     774    return !TunerSet(
     775        "vchannel", vchn).isEmpty();
     776}
  • hdhrchannel.cpp

     
    182182        }
    183183        else
    184184        {
    185             VERBOSE(VB_IMPORTANT, LOC_ERR +
    186                     "dtv_multiplex data is required for tuning");
     185            if (!_stream_handler->TuneVChannel(channum))
     186            {
     187                VERBOSE(VB_IMPORTANT, LOC_ERR +
     188                        "dtv_multiplex data is required for tuning");
     189                return false;
     190            }
    187191
    188             return false;
     192            SetSIStandard(si_std);
    189193        }
    190194    }
    191195    else if (!ChangeExternalChannel(freqid))
     
    202206    QString tmpX = m_curchannelname; tmpX.detach();
    203207    m_inputs[m_currentInputID]->startChanNum = tmpX;
    204208
    205     // Turn on the program filtering if tuning to MPEG stream
    206     if (mpeg_prog_num && (GetTuningMode() == "mpeg"))
    207         _stream_handler->TuneProgram(mpeg_prog_num);
    208 
    209209    return true;
    210210}
    211211
  • tv_play.cpp

     
    46154615    else if (has_action("NEXTFAV", actions) && islivetv)
    46164616        ChangeChannel(ctx, CHANNEL_DIRECTION_FAVORITE);
    46174617    else if (has_action("NEXTSOURCE", actions) && islivetv)
    4618         SwitchSource(kNextSource);
     4618        SwitchSource(ctx, kNextSource);
    46194619    else if (has_action("PREVSOURCE", actions) && islivetv)
    4620         SwitchSource(kPreviousSource);
     4620        SwitchSource(ctx, kPreviousSource);
    46214621    else if (has_action("NEXTINPUT", actions) && islivetv)
    46224622        ToggleInputs(ctx);
    46234623    else if (has_action("NEXTCARD", actions) && islivetv)
     
    63136313        SetMuteTimer(ctx, kMuteTimeout);
    63146314}
    63156315
    6316 void TV::SwitchSource(uint source_direction)
     6316void TV::SwitchSource(PlayerContext *ctx, uint source_direction)
    63176317{
    6318     PlayerContext *actx = GetPlayerReadLock(-1, __FILE__, __LINE__);
    6319     if (!actx->recorder)
    6320     {
    6321         ReturnPlayerLock(actx);
    6322         return;
    6323     }
    63246318    QMap<uint,InputInfo> sources;
    63256319    vector<uint> cardids = RemoteRequestFreeRecorderList();
    6326     uint         cardid  = actx->GetCardID();
     6320    uint         cardid  = ctx->GetCardID();
    63276321    cardids.push_back(cardid);
    63286322    stable_sort(cardids.begin(), cardids.end());
    63296323
     
    63316325    excluded_cardids.push_back(cardid);
    63326326
    63336327    InfoMap info;
    6334     actx->recorder->GetChannelInfo(info);
     6328    ctx->recorder->GetChannelInfo(info);
    63356329    uint sourceid = info["sourceid"].toUInt();
    63366330
    63376331    vector<uint>::const_iterator it = cardids.begin();
     
    63616355
    63626356    if (sit == sources.end())
    63636357    {
    6364         ReturnPlayerLock(actx);
    63656358        return;
    63666359    }
    63676360
     
    63896382
    63906383    if (sit == beg)
    63916384    {
    6392         ReturnPlayerLock(actx);
    63936385        return;
    63946386    }
    63956387
    63966388    switchToInputId = (*sit).inputid;
    6397     ReturnPlayerLock(actx);
    63986389
    63996390    QMutexLocker locker(&timerIdLock);
    64006391    if (!switchToInputTimerId)
  • hdhrstreamhandler.h

     
    2727struct hdhomerun_device_t { int dummy; };
    2828#endif
    2929
     30enum HDHRTuneMode {
     31    hdhrTuneModeNone = 0,
     32    hdhrTuneModeFrequency,
     33    hdhrTuneModeFrequencyPid,
     34    hdhrTuneModeFrequencyProgram,
     35    hdhrTuneModeVChannel
     36};
     37
    3038typedef QMap<uint,int> FilterMap;
    3139
    3240//#define RETUNE_TIMEOUT 5000
     
    5058    // Commands
    5159    bool TuneChannel(const QString &chanid);
    5260    bool TuneProgram(uint mpeg_prog_num);
     61    bool TuneVChannel(const QString &vchn);
    5362    bool EnterPowerSavingMode(void);
    5463
    5564
     
    91100
    92101  private:
    93102    hdhomerun_device_t *_hdhomerun_device;
    94     uint                _tuner;
    95     QString             _devicename;
     103    uint                 _tuner;
     104    QString              _devicename;
    96105    vector<DTVTunerType> _tuner_types;
     106    HDHRTuneMode         _tune_mode; // debug self check
    97107
    98108    mutable QMutex    _start_stop_lock;
    99109    bool              _running;