Ticket #328: dbox2-fix.patch

File dbox2-fix.patch, 2.9 KB (added by danielk, 20 years ago)

dbox2 fix

  • libs/libmythtv/tv_rec.cpp

     
    185185        channel = new DBox2Channel(this, &dboxOpt, cardid);
    186186        channel->Open();
    187187        InitChannel(genOpt.defaultinput, startchannel);
     188        connect(GetDBox2Channel(), SIGNAL(ChannelChanged()),
     189                this, SLOT(DBox2ChannelChanged()));
     190
    188191        init_run = true;
    189192#endif
    190193    }
     
    28352838    }
    28362839
    28372840    // Clear the RingBuffer reset flag, in case we wait for a reset below
    2838     ClearFlags(kFlagRingBufferReset);
     2841    // Also clear DBox2ChannelChanged flag, in case tuning proc waits on DBox2
     2842    ClearFlags(kFlagRingBufferReset | kFlagDBox2ChannelChanged);
    28392843
    28402844    // Actually add the tuning request to the queue, and
    28412845    // then wait for it to start tuning
     
    32903294        ClearFlags(kFlagWaitingForRecPause);
    32913295        if (ringBuffer)
    32923296            ringBuffer->Reset();
     3297        TuningFrequency(lastTuningRequest);
     3298
     3299        // BEGIN UGLY Hack! DBOX should use signal monitor class
     3300        // instead of the ChannelChanged signal.
     3301        while (GetDBox2Channel() && !HasFlags(kFlagDBox2ChannelChanged))
     3302        {
     3303            stateChangeLock.unlock();
     3304            triggerEventLoop.wait(1000 /* ms */);
     3305            stateChangeLock.lock();
     3306        }
     3307        // END UGLY Hack
     3308
    32933309        SetFlags(kFlagRingBufferReset);
    3294         TuningFrequency(lastTuningRequest);
    32953310    }
    32963311
    32973312    if (HasFlags(kFlagWaitingForSignal))
  • libs/libmythtv/tv_rec.h

     
    253253        { QMutexLocker lock(&stateChangeLock); triggerEventLoop.wakeAll(); }
    254254
    255255  public slots:
     256    void DBox2ChannelChanged()  { SetFlags(kFlagDBox2ChannelChanged); }
    256257    void SignalMonitorAllGood() { triggerEventLoop.wakeAll(); }
    257258    void SetPMTObject(const PMTObject*)
    258259        { QMutexLocker lock(&stateChangeLock); triggerEventLoop.wakeAll(); }
     
    448449    static const uint kFlagSIParserRunning      = 0x02000000;
    449450    static const uint kFlagEITScannerRunning    = 0x04000000;
    450451
    451     static const uint kFlagDummyRecorderRunning = 0x10000000;
    452     static const uint kFlagRecorderRunning      = 0x20000000;
    453     static const uint kFlagAnyRecRunning        = 0x30000000;
    454     static const uint kFlagAnyRunning           = 0x3F000000;
     452    static const uint kFlagDummyRecorderRunning = 0x08000000;
     453    static const uint kFlagRecorderRunning      = 0x10000000;
     454    static const uint kFlagAnyRecRunning        = 0x18000000;
     455    static const uint kFlagAnyRunning           = 0x1F000000;
    455456
    456457    // Tuning state
     458    static const uint kFlagDBox2ChannelChanged  = 0x20000000;
    457459    static const uint kFlagRingBufferReset      = 0x40000000;
    458460    static const uint kFlagDetect               = 0x80000000;
    459461};