Ticket #8742: ringbuffer-early.patch

File ringbuffer-early.patch, 2.3 KB (added by jpoet, 15 years ago)

Fix LiveTV DB contention error

  • libs/libmythtv/channelbase.h

     
    131131
    132132    // \brief Set cardid for scanning
    133133    void SetCardID(uint _cardid) { m_cardid = _cardid; }
     134    // \brief Set chan name for ringbuffer
     135    void SetChanNum(const QString & chan) { m_curchannelname= chan; }
    134136
    135137    virtual int GetCardID(void) const;
    136138  protected:
  • libs/libmythtv/tv_rec.cpp

     
    37463746    else
    37473747        ok = true;
    37483748
     3749    if (livetv || antadj)
     3750    {
     3751        // We need there to be a ringbuffer for these modes
     3752        bool ok;
     3753        ProgramInfo *tmp = pseudoLiveTVRecording;
     3754        pseudoLiveTVRecording = NULL;
     3755
     3756        if (channel)
     3757            channel->SetChanNum(channum);
     3758        tvchain->SetCardType("DUMMY");
     3759
     3760        if (!ringBuffer)
     3761            ok = CreateLiveTVRingBuffer();
     3762        else
     3763            ok = SwitchLiveTVRingBuffer(true, false);
     3764        pseudoLiveTVRecording = tmp;
     3765
     3766        tvchain->SetCardType(genOpt.cardtype);
     3767
     3768        if (!ok)
     3769        {
     3770            VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create RingBuffer 1");
     3771            return;
     3772        }
     3773
     3774        has_dummy = true;
     3775    }
     3776
    37493777    if (channel && !channum.isEmpty())
    37503778    {
    37513779        if (!input.isEmpty())
     
    37813809        }
    37823810    }
    37833811
    3784     if (livetv || antadj)
    3785     {
    3786         // We need there to be a ringbuffer for these modes
    3787         bool ok;
    3788         ProgramInfo *tmp = pseudoLiveTVRecording;
    3789         pseudoLiveTVRecording = NULL;
    3790 
    3791         tvchain->SetCardType("DUMMY");
    3792 
    3793         if (!ringBuffer)
    3794             ok = CreateLiveTVRingBuffer();
    3795         else
    3796             ok = SwitchLiveTVRingBuffer(true, false);
    3797         pseudoLiveTVRecording = tmp;
    3798 
    3799         tvchain->SetCardType(genOpt.cardtype);
    3800 
    3801         if (!ok)
    3802         {
    3803             VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create RingBuffer 1");
    3804             return;
    3805         }
    3806 
    3807         has_dummy = true;
    3808     }
    3809 
    38103812    // Start signal (or channel change) monitoring
    38113813    VERBOSE(VB_RECORD, LOC + "Starting Signal Monitor");
    38123814    bool error = false;