Ticket #11475: filter-test.patch

File filter-test.patch, 2.1 KB (added by Gary Buhrmaster <gary.buhrmaster@…>, 7 years ago)

Proof of concept filter patch

  • mythtv/libs/libmythtv/hdhrstreamhandler.cpp

    diff --git a/mythtv/libs/libmythtv/hdhrstreamhandler.cpp b/mythtv/libs/libmythtv/hdhrstreamhandler.cpp
    index d771761..39231da 100644
    a b bool HDHRStreamHandler::UpdateFilters(void) 
    250250
    251251    filter = filter.trimmed();
    252252
     253    if (_filters_changed == false)
     254    {
     255        return 1;
     256    }
     257
    253258    QString new_filter = TunerSet("filter", filter);
    254259
    255260#ifdef DEBUG_PID_FILTERS
    bool HDHRStreamHandler::UpdateFilters(void) 
    260265    LOG(VB_RECORD, LOG_INFO, LOC + msg);
    261266#endif // DEBUG_PID_FILTERS
    262267
     268    _filters_changed = false;
     269
    263270    return filter == new_filter;
    264271}
    265272
  • mythtv/libs/libmythtv/streamhandler.cpp

    diff --git a/mythtv/libs/libmythtv/streamhandler.cpp b/mythtv/libs/libmythtv/streamhandler.cpp
    index 807ba9d..ed017c7 100644
    a b StreamHandler::StreamHandler(const QString &device) : 
    1919
    2020    _pid_lock(QMutex::Recursive),
    2121    _open_pid_filters(0),
     22    _filters_changed(false),
    2223
    2324    _listener_lock(QMutex::Recursive)
    2425{
    bool StreamHandler::AddPIDFilter(PIDInfo *info) 
    210211    QMutexLocker writing_locker(&_pid_lock);
    211212    _pid_info[info->_pid] = info;
    212213
     214    _filters_changed = true;
     215
    213216    CycleFiltersByPriority();
    214217
    215218    return true;
    bool StreamHandler::RemovePIDFilter(uint pid) 
    231234    PIDInfo *tmp = *it;
    232235    _pid_info.erase(it);
    233236
     237    _filters_changed = true;
     238
    234239    bool ok = true;
    235240    if (tmp->IsOpen())
    236241    {
  • mythtv/libs/libmythtv/streamhandler.h

    diff --git a/mythtv/libs/libmythtv/streamhandler.h b/mythtv/libs/libmythtv/streamhandler.h
    index 00627b0..0a49bb9 100644
    a b class StreamHandler : protected MThread, public DeviceReaderCB 
    117117    vector<uint>      _eit_pids;
    118118    PIDInfoMap        _pid_info;
    119119    uint              _open_pid_filters;
     120    bool              _filters_changed;
    120121    MythTimer         _cycle_timer;
    121122
    122123    typedef QMap<MPEGStreamData*,QString> StreamDataList;