Ticket #13247: 13247-1.patch

File 13247-1.patch, 3.9 KB (added by gigem, 3 years ago)
  • mythtv/libs/libmythtv/tv_rec.cpp

    diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp
    index ecb43af392..6556380a1f 100644
    a b void TVRec::HandleTuning(void) 
    35513551    }
    35523552}
    35533553
    3554 /** \fn TVRec::TuningCheckForHWChange(const TuningRequest&,QString&,QString&)
    3555  *  \brief Returns inputid for device info row in capturecard if it changes.
    3556  */
    3557 uint TVRec::TuningCheckForHWChange(const TuningRequest &request,
    3558                                    QString &channum,
    3559                                    QString &inputname)
    3560 {
    3561      LOG(VB_RECORD, LOG_INFO, LOC + QString("request (%1) channum (%2) inputname (%3)")
    3562                                             .arg(request.toString()).arg(channum).arg(inputname));
    3563     if (!channel)
    3564         return 0;
    3565 
    3566     uint curInputID = 0, newInputID = 0;
    3567     channum   = request.channel;
    3568     inputname = request.input;
    3569 
    3570     if (request.program)
    3571         request.program->QueryTuningInfo(channum, inputname);
    3572 
    3573     if (!channum.isEmpty() && inputname.isEmpty())
    3574         channel->CheckChannel(channum);
    3575 
    3576     if (!inputname.isEmpty())
    3577     {
    3578         curInputID = channel->GetInputID();
    3579         newInputID = channel->GetInputID();
    3580         LOG(VB_GENERAL, LOG_INFO, LOC + QString("HW Tuner: %1->%2")
    3581                 .arg(curInputID).arg(newInputID));
    3582     }
    3583 
    3584     if (curInputID != newInputID || !CardUtil::IsChannelReusable(genOpt.inputtype))
    3585     {
    3586         LOG(VB_RECORD, LOG_INFO, LOC + QString("Inputtype HW Tuner newinputid channum curinputid: %1->%2 %3")
    3587                                                .arg(curInputID).arg(newInputID).arg(channum));
    3588         if (channum.isEmpty())
    3589             channum = GetStartChannel(newInputID);
    3590         return newInputID;
    3591     }
    3592 
    3593     return 0;
    3594 }
    3595 
    35963554/** \fn TVRec::TuningShutdowns(const TuningRequest&)
    35973555 *  \brief This shuts down anything that needs to be shut down
    35983556 *         before handling the passed in tuning request.
    void TVRec::TuningShutdowns(const TuningRequest &request) 
    36033561        .arg(request.toString()));
    36043562
    36053563    QString channum, inputname;
    3606     uint newInputID = TuningCheckForHWChange(request, channum, inputname);
    36073564
    36083565    if (scanner && !(request.flags & kFlagEITScan) &&
    36093566        HasFlags(kFlagEITScannerRunning))
    void TVRec::TuningShutdowns(const TuningRequest &request) 
    36353592
    36363593    // At this point any waits are canceled.
    36373594
    3638     if (newInputID || (request.flags & kFlagNoRec))
     3595    if (request.flags & kFlagNoRec)
    36393596    {
    36403597        if (HasFlags(kFlagDummyRecorderRunning))
    36413598        {
    void TVRec::TuningShutdowns(const TuningRequest &request) 
    36593616        // At this point the channel is shut down
    36603617    }
    36613618
    3662     // handle HW change for digital/analog inputs
    3663     if (newInputID)
    3664     {
    3665         LOG(VB_CHANNEL, LOG_INFO, LOC +
    3666             "TuningShutdowns: Recreating channel...");
    3667         channel->Close();
    3668         delete channel;
    3669         channel = NULL;
    3670 
    3671         GetDevices(newInputID, genOpt, dvbOpt, fwOpt);
    3672         CreateChannel(channum, false);
    3673     }
    3674 
    36753619    if (ringBuffer && (request.flags & kFlagKillRingBuffer))
    36763620    {
    36773621        LOG(VB_RECORD, LOG_INFO, LOC + "Tearing down RingBuffer");
  • mythtv/libs/libmythtv/tv_rec.h

    diff --git a/mythtv/libs/libmythtv/tv_rec.h b/mythtv/libs/libmythtv/tv_rec.h
    index e8106d8b40..20fb29b21e 100644
    a b class MTV_PUBLIC TVRec : public SignalMonitorListener, public QRunnable 
    299299    void TuningNewRecorder(MPEGStreamData*);
    300300    void TuningRestartRecorder(void);
    301301    QString TuningGetChanNum(const TuningRequest&, QString &input) const;
    302     uint TuningCheckForHWChange(const TuningRequest&,
    303                                 QString &channum,
    304                                 QString &inputname);
    305302    bool TuningOnSameMultiplex(TuningRequest &request);
    306303
    307304    void HandleStateChange(void);