Ticket #13247: 13247-2.patch

File 13247-2.patch, 5.5 KB (added by gigem, 3 years ago)
  • mythtv/libs/libmythtv/recorders/v4lchannel.cpp

    diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp
    index f4e268628e..fccbaea966 100644
    a b V4LChannel::V4LChannel(TVRec *parent, const QString &videodevice, 
    4040      audio_device(audiodevice),    videofd(-1),
    4141      device_name(),                driver_name(),
    4242      curList(NULL),                totalChannels(0),
    43       currentFormat(),
    4443      has_stream_io(false),         has_std_io(false),
    4544      has_async_io(false),
    4645      has_tuner(false),             has_sliced_vbi(false),
    void V4LChannel::SetFormat(const QString &format) 
    301300    LOG(VB_CHANNEL, LOG_INFO, LOC + QString("SetFormat(%1) fmt(%2) input(%3)")
    302301            .arg(format).arg(fmt).arg(inputNum));
    303302
    304     if ((fmt == currentFormat) || SetInputAndFormat(inputNum, fmt))
    305     {
    306         currentFormat = fmt;
    307     }
     303    if (!SetInputAndFormat(inputNum, fmt))
     304        LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to set format." + ENO);
     305
    308306}
    309307
    310308int V4LChannel::SetDefaultFreqTable(const QString &name)
  • mythtv/libs/libmythtv/recorders/v4lchannel.h

    diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.h b/mythtv/libs/libmythtv/recorders/v4lchannel.h
    index 6b6b54ae88..bdabb47359 100644
    a b class V4LChannel : public DTVChannel 
    9494    struct CHANLIST *curList;
    9595    int         totalChannels;
    9696
    97     QString     currentFormat;
    9897    bool        has_stream_io;
    9998    bool        has_std_io;
    10099    bool        has_async_io;
  • 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);