diff --git a/mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp index 64061762d37..f173502b5ea 100644 --- a/mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp +++ b/mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp @@ -57,7 +57,7 @@ ATSCStreamData::~ATSCStreamData() _atsc81_eit_listeners.clear(); } -void ATSCStreamData::SetDesiredChannel(int major, int minor) +void ATSCStreamData::SetDesiredChannel(int major, int minor, int cardid) { bool reset = true; const MasterGuideTable *mgt = GetCachedMGT(); @@ -91,12 +91,12 @@ void ATSCStreamData::SetDesiredChannel(int major, int minor) if (cvct) { ProcessCVCT(cvct->TransportStreamID(), cvct); - SetDesiredProgram(cvct->ProgramNumber(chan_idx)); + SetDesiredProgram(cvct->ProgramNumber(chan_idx), cardid); } else if (tvct) { ProcessTVCT(tvct->TransportStreamID(), tvct); - SetDesiredProgram(tvct->ProgramNumber(chan_idx)); + SetDesiredProgram(tvct->ProgramNumber(chan_idx), cardid); } reset = false; } diff --git a/mythtv/libs/libmythtv/mpeg/atscstreamdata.h b/mythtv/libs/libmythtv/mpeg/atscstreamdata.h index e577256a5c6..866c9e2b0a5 100644 --- a/mythtv/libs/libmythtv/mpeg/atscstreamdata.h +++ b/mythtv/libs/libmythtv/mpeg/atscstreamdata.h @@ -35,7 +35,7 @@ class MTV_PUBLIC ATSCStreamData : virtual public MPEGStreamData virtual void Reset(void) { ResetATSC(-1, -1); } virtual void ResetMPEG(int desiredProgram); virtual void ResetATSC(int desiredMajorChannel, int desiredMinorChannel); - void SetDesiredChannel(int major, int minor); + void SetDesiredChannel(int major, int minor, int cardid); // Table processing virtual bool HandleTables(uint pid, const PSIPTable &psip); diff --git a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp index d09017edd97..dce41a4205b 100644 --- a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp +++ b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp @@ -40,7 +40,8 @@ DVBStreamData::~DVBStreamData() _dvb_has_eit.clear(); } -void DVBStreamData::SetDesiredService(uint netid, uint tsid, int serviceid) +void DVBStreamData::SetDesiredService(uint netid, uint tsid, int serviceid, + int cardid) { bool reset = true; @@ -62,7 +63,7 @@ void DVBStreamData::SetDesiredService(uint netid, uint tsid, int serviceid) ProcessSDT(_desired_tsid, sdt); ReturnCachedTable(sdt); } - SetDesiredProgram(serviceid); + SetDesiredProgram(serviceid, cardid); } } diff --git a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h index 05cc6281eee..e968b7a7f88 100644 --- a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h +++ b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h @@ -36,7 +36,7 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData uint desired_netid, uint desired_tsid, int desired_sid); // DVB table monitoring - void SetDesiredService(uint netid, uint tsid, int serviceid); + void SetDesiredService(uint netid, uint tsid, int serviceid, int cardid); uint DesiredNetworkID(void) const { return _desired_netid; } uint DesiredTransportID(void) const { return _desired_tsid; } diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp index 489c5479e73..5b01a2b5e63 100644 --- a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp +++ b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp @@ -105,13 +105,16 @@ MPEGStreamData::~MPEGStreamData() _mpeg_sp_listeners.clear(); } -void MPEGStreamData::SetDesiredProgram(int p) +void MPEGStreamData::SetDesiredProgram(int p, int cardid) { bool reset = true; uint pid = 0; const ProgramAssociationTable* pat = NULL; pat_vec_t pats = GetCachedPATs(); + LOG(VB_RECORD, LOG_INFO, QString("SetDesiredProgram[%1] (%2)") + .arg(cardid).arg(p)); + for (uint i = (p) ? 0 : pats.size(); i < pats.size() && !pid; i++) { pat = pats[i]; @@ -812,8 +815,7 @@ void MPEGStreamData::ProcessPAT(const ProgramAssociationTable *pat) { _invalid_pat_warning = true; // only emit one warning... // After 400ms emit error if we haven't found correct PAT. - LOG(VB_GENERAL, LOG_ERR, - "ProcessPAT: Program not found in PAT. " + LOG(VB_GENERAL, LOG_ERR, "ProcessPAT: Program not found in PAT. " "Rescan your transports."); send_single_program = CreatePATSingleProgram(*pat); diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h index 94ad37dac75..de8f7f1f6e8 100644 --- a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h +++ b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h @@ -291,7 +291,7 @@ class MTV_PUBLIC MPEGStreamData : public EITSource public: // Single program stuff, sets - void SetDesiredProgram(int p); + void SetDesiredProgram(int p, int cardid); inline void SetPATSingleProgram(ProgramAssociationTable*); inline void SetPMTSingleProgram(ProgramMapTable*); void SetVideoStreamsRequired(uint num) diff --git a/mythtv/libs/libmythtv/recorders/analogsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/analogsignalmonitor.cpp index 3a52b8891ff..0237ccbb2b3 100644 --- a/mythtv/libs/libmythtv/recorders/analogsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/analogsignalmonitor.cpp @@ -14,7 +14,8 @@ #include "analogsignalmonitor.h" #include "v4lchannel.h" -#define LOC QString("AnalogSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("AnalogSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) AnalogSignalMonitor::AnalogSignalMonitor( int db_cardnum, V4LChannel *_channel, uint64_t _flags) : diff --git a/mythtv/libs/libmythtv/recorders/asichannel.cpp b/mythtv/libs/libmythtv/recorders/asichannel.cpp index f9875a28eaf..612e234595f 100644 --- a/mythtv/libs/libmythtv/recorders/asichannel.cpp +++ b/mythtv/libs/libmythtv/recorders/asichannel.cpp @@ -7,7 +7,7 @@ #include "mpegtables.h" #include "asichannel.h" -#define LOC QString("ASIChan(%1): ").arg(GetDevice()) +#define LOC QString("ASIChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) ASIChannel::ASIChannel(TVRec *parent, const QString &device) : DTVChannel(parent), m_device(device), m_isopen(false) diff --git a/mythtv/libs/libmythtv/recorders/asirecorder.cpp b/mythtv/libs/libmythtv/recorders/asirecorder.cpp index b6cb4dfe1d3..d6160539a7e 100644 --- a/mythtv/libs/libmythtv/recorders/asirecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/asirecorder.cpp @@ -28,7 +28,9 @@ #include "ringbuffer.h" #include "tv_rec.h" -#define LOC QString("ASIRec(%1): ").arg(tvrec->GetCaptureCardNum()) +#define LOC QString("ASIRec[%1](%2): ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1) \ + .arg(channel->GetDevice()) ASIRecorder::ASIRecorder(TVRec *rec, ASIChannel *channel) : DTVRecorder(rec), m_channel(channel), m_stream_handler(NULL), diff --git a/mythtv/libs/libmythtv/recorders/asisignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/asisignalmonitor.cpp index 319abe72960..29a4c8d5961 100644 --- a/mythtv/libs/libmythtv/recorders/asisignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/asisignalmonitor.cpp @@ -21,7 +21,8 @@ #include "asirecorder.h" #include "asistreamhandler.h" -#define LOC QString("ASISM(%1): ").arg(channel->GetDevice()) +#define LOC QString("ASISM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) /** * \brief Initializes signal lock and signal values. diff --git a/mythtv/libs/libmythtv/recorders/cetonchannel.cpp b/mythtv/libs/libmythtv/recorders/cetonchannel.cpp index ccdcb0c0e0a..dd5f4c7206b 100644 --- a/mythtv/libs/libmythtv/recorders/cetonchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/cetonchannel.cpp @@ -13,7 +13,7 @@ #include "channelutil.h" #include "mythdbcon.h" -#define LOC QString("CetonChan(%1): ").arg(GetDevice()) +#define LOC QString("CetonChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) CetonChannel::CetonChannel(TVRec *parent, const QString &device) : DTVChannel(parent), _device_id(device), _stream_handler(NULL) diff --git a/mythtv/libs/libmythtv/recorders/cetonrecorder.cpp b/mythtv/libs/libmythtv/recorders/cetonrecorder.cpp index f7aacf4d4fe..8910c66e4f8 100644 --- a/mythtv/libs/libmythtv/recorders/cetonrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/cetonrecorder.cpp @@ -12,7 +12,8 @@ #include "mythlogging.h" #include "tv_rec.h" -#define LOC QString("CetonRec(%1): ").arg(tvrec->GetCaptureCardNum()) +#define LOC QString("CetonRec[%1]: ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1) CetonRecorder::CetonRecorder(TVRec *rec, CetonChannel *channel) : DTVRecorder(rec), _channel(channel), _stream_handler(NULL) diff --git a/mythtv/libs/libmythtv/recorders/cetonsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/cetonsignalmonitor.cpp index 789726d2071..4e168aa1ddc 100644 --- a/mythtv/libs/libmythtv/recorders/cetonsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/cetonsignalmonitor.cpp @@ -13,7 +13,8 @@ #include "cetonrecorder.h" #include "cetonchannel.h" -#define LOC QString("CetonSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("CetonSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) /** * \brief Initializes signal lock and signal values. diff --git a/mythtv/libs/libmythtv/recorders/channelbase.cpp b/mythtv/libs/libmythtv/recorders/channelbase.cpp index f3f904af72d..88a89a755ce 100644 --- a/mythtv/libs/libmythtv/recorders/channelbase.cpp +++ b/mythtv/libs/libmythtv/recorders/channelbase.cpp @@ -43,7 +43,7 @@ using namespace std; #include "cardutil.h" #include "compat.h" -#define LOC QString("ChannelBase(%1): ").arg(GetCardID()) +#define LOC QString("ChannelBase[%1]: ").arg(GetCardID()) ChannelBase::ChannelBase(TVRec *parent) : m_pParent(parent), m_curchannelname(""), diff --git a/mythtv/libs/libmythtv/recorders/dtvchannel.cpp b/mythtv/libs/libmythtv/recorders/dtvchannel.cpp index ef830c753dc..204f727c93b 100644 --- a/mythtv/libs/libmythtv/recorders/dtvchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvchannel.cpp @@ -10,7 +10,7 @@ using namespace std; #include "mpegtables.h" #include "mythlogging.h" -#define LOC QString("DTVChan(%1): ").arg(GetDevice()) +#define LOC QString("DTVChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) QReadWriteLock DTVChannel::master_map_lock(QReadWriteLock::Recursive); typedef QMap > MasterMap; diff --git a/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp b/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp index 0c30b10e444..f888429b723 100644 --- a/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp @@ -33,7 +33,7 @@ extern "C" { } #define LOC ((tvrec) ? \ - QString("DTVRec(%1): ").arg(tvrec->GetCaptureCardNum()) : \ + QString("DTVRec[%1]: ").arg(tvrec->GetCaptureCardNum()) : \ QString("DTVRec(0x%1): ").arg(intptr_t(this),0,16)) const uint DTVRecorder::kMaxKeyFrameDistance = 80; @@ -269,9 +269,11 @@ void DTVRecorder::InitStreamData(void) if (atsc && atsc->DesiredMinorChannel()) atsc->SetDesiredChannel(atsc->DesiredMajorChannel(), - atsc->DesiredMinorChannel()); + atsc->DesiredMinorChannel(), + tvrec ? tvrec->GetCaptureCardNum() : -1); else if (_stream_data->DesiredProgram() >= 0) - _stream_data->SetDesiredProgram(_stream_data->DesiredProgram()); + _stream_data->SetDesiredProgram(_stream_data->DesiredProgram(), + tvrec ? tvrec->GetCaptureCardNum() : -1); } void DTVRecorder::BufferedWrite(const TSPacket &tspacket) diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp index e08f46fdab3..412132b4342 100644 --- a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp @@ -14,9 +14,11 @@ using namespace std; #undef DBG_SM #define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_INFO, \ - QString("DTVSM(%1)::%2: %3").arg(channel->GetDevice()).arg(FUNC).arg(MSG)) + QString("DTVSM[%1](%2)::%3: %4").arg(capturecardnum) \ + .arg(channel->GetDevice()).arg(FUNC).arg(MSG)) -#define LOC QString("DTVSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("DTVSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) // inserts tid&crc value into an ordered list // returns true if item is inserted @@ -211,7 +213,7 @@ void DTVSignalMonitor::SetChannel(int major, int minor) kDTVSigMon_CryptSeen | kDTVSigMon_CryptMatch); majorChannel = major; minorChannel = minor; - GetATSCStreamData()->SetDesiredChannel(major, minor); + GetATSCStreamData()->SetDesiredChannel(major, minor, capturecardnum); AddFlags(kDTVSigMon_WaitForVCT | kDTVSigMon_WaitForPAT); } } @@ -226,7 +228,7 @@ void DTVSignalMonitor::SetProgramNumber(int progNum) kDTVSigMon_CryptSeen | kDTVSigMon_CryptMatch); programNumber = progNum; if (GetStreamData()) - GetStreamData()->SetDesiredProgram(programNumber); + GetStreamData()->SetDesiredProgram(programNumber, capturecardnum); AddFlags(kDTVSigMon_WaitForPMT); } } @@ -253,7 +255,8 @@ void DTVSignalMonitor::SetDVBService(uint netid, uint tsid, int serviceid) if (GetDVBStreamData()) { - GetDVBStreamData()->SetDesiredService(netid, tsid, programNumber); + GetDVBStreamData()->SetDesiredService(netid, tsid, programNumber, + capturecardnum); AddFlags(kDTVSigMon_WaitForPMT | kDTVSigMon_WaitForSDT); GetDVBStreamData()->AddListeningPID(DVB_SDT_PID); } diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp index b46878d7f09..323670eecb7 100644 --- a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp @@ -55,7 +55,7 @@ static struct dvb_frontend_parameters dtvmultiplex_to_dvbparams( static DTVMultiplex dvbparams_to_dtvmultiplex( DTVTunerType, const dvb_frontend_parameters&); -#define LOC QString("DVBChan(%1:%2): ").arg(GetCardID()).arg(device) +#define LOC QString("DVBChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) /** \class DVBChannel * \brief Provides interface to the tuning hardware when using DVB drivers diff --git a/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp b/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp index c1b66d59ce5..9aba52fa50d 100644 --- a/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbrecorder.cpp @@ -29,8 +29,8 @@ #include "tv_rec.h" #include "mythlogging.h" -#define LOC QString("DVBRec(%1:%2): ") \ - .arg(tvrec->GetCaptureCardNum()).arg(videodevice) +#define LOC QString("DVBRec[%1](%2): ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1).arg(videodevice) DVBRecorder::DVBRecorder(TVRec *rec, DVBChannel *channel) : DTVRecorder(rec), _channel(channel), _stream_handler(NULL) diff --git a/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp index 1fa010e23ef..51d28b8f34a 100644 --- a/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/dvbsignalmonitor.cpp @@ -21,7 +21,8 @@ #include "dvbrecorder.h" #include "dvbstreamhandler.h" -#define LOC QString("DVBSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("DVBSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) /** * \brief Initializes signal lock and signal values. diff --git a/mythtv/libs/libmythtv/recorders/firewirechannel.cpp b/mythtv/libs/libmythtv/recorders/firewirechannel.cpp index 2ed2c5a3a64..92e2d1f769f 100644 --- a/mythtv/libs/libmythtv/recorders/firewirechannel.cpp +++ b/mythtv/libs/libmythtv/recorders/firewirechannel.cpp @@ -13,7 +13,7 @@ #endif #include "firewirechannel.h" -#define LOC QString("FireChan(%1): ").arg(GetDevice()) +#define LOC QString("FireChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) FirewireChannel::FirewireChannel(TVRec *parent, const QString &_videodevice, const FireWireDBOptions &firewire_opts) : diff --git a/mythtv/libs/libmythtv/recorders/firewirerecorder.cpp b/mythtv/libs/libmythtv/recorders/firewirerecorder.cpp index 335895f2551..d7c6ae665e3 100644 --- a/mythtv/libs/libmythtv/recorders/firewirerecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/firewirerecorder.cpp @@ -12,7 +12,9 @@ #include "mpegstreamdata.h" #include "tv_rec.h" -#define LOC QString("FireRecBase(%1): ").arg(channel->GetDevice()) +#define LOC QString("FireRecBase[%1](%2): ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1) \ + .arg(channel->GetDevice()) FirewireRecorder::FirewireRecorder(TVRec *rec, FirewireChannel *chan) : DTVRecorder(rec), diff --git a/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.cpp index 6c0a05d41b9..a7939f8dfc3 100644 --- a/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/firewiresignalmonitor.cpp @@ -13,7 +13,8 @@ #include "firewiresignalmonitor.h" #include "mythlogging.h" -#define LOC QString("FireSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("FireSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) void FirewireTableMonitorThread::run(void) { diff --git a/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp b/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp index e6690141ba3..aa60fa350a3 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/hdhrchannel.cpp @@ -28,7 +28,7 @@ using namespace std; #include "channelutil.h" #include "hdhrstreamhandler.h" -#define LOC QString("HDHRChan(%1): ").arg(GetDevice()) +#define LOC QString("HDHRChan[%1](%2): ").arg(GetCardID()).arg(GetDevice()) HDHRChannel::HDHRChannel(TVRec *parent, const QString &device) : DTVChannel(parent), diff --git a/mythtv/libs/libmythtv/recorders/hdhrrecorder.cpp b/mythtv/libs/libmythtv/recorders/hdhrrecorder.cpp index c8e14368497..363d373f62c 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/hdhrrecorder.cpp @@ -13,7 +13,8 @@ #include "tv_rec.h" #include "mythlogging.h" -#define LOC QString("HDHRRec(%1): ").arg(tvrec->GetCaptureCardNum()) +#define LOC QString("HDHRRec[%1]: ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1) HDHRRecorder::HDHRRecorder(TVRec *rec, HDHRChannel *channel) : DTVRecorder(rec), _channel(channel), _stream_handler(NULL) diff --git a/mythtv/libs/libmythtv/recorders/hdhrsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/hdhrsignalmonitor.cpp index a08088231c7..93b6a612908 100644 --- a/mythtv/libs/libmythtv/recorders/hdhrsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/hdhrsignalmonitor.cpp @@ -21,7 +21,8 @@ #include "hdhrrecorder.h" #include "hdhrstreamhandler.h" -#define LOC QString("HDHRSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("HDHRSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) /** * \brief Initializes signal lock and signal values. diff --git a/mythtv/libs/libmythtv/recorders/importrecorder.cpp b/mythtv/libs/libmythtv/recorders/importrecorder.cpp index fbbb4d67c07..990c1bae981 100644 --- a/mythtv/libs/libmythtv/recorders/importrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/importrecorder.cpp @@ -39,8 +39,8 @@ #define TVREC_CARDNUM \ ((tvrec != NULL) ? QString::number(tvrec->GetCaptureCardNum()) : "NULL") -#define LOC QString("ImportRec(%1:%2): ") \ - .arg(TVREC_CARDNUM).arg(videodevice) +#define LOC QString("ImportRec[%1](%2): ") \ + .arg(TVREC_CARDNUM).arg(videodevice) ImportRecorder::ImportRecorder(TVRec *rec) : DTVRecorder(rec), _import_fd(-1) diff --git a/mythtv/libs/libmythtv/recorders/iptvchannel.cpp b/mythtv/libs/libmythtv/recorders/iptvchannel.cpp index de2099aa110..941aa6eb85f 100644 --- a/mythtv/libs/libmythtv/recorders/iptvchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/iptvchannel.cpp @@ -16,7 +16,7 @@ #include "mythlogging.h" #include "mythdb.h" -#define LOC QString("IPTVChan(%1): ").arg(GetCardID()) +#define LOC QString("IPTVChan[%1]: ").arg(GetCardID()) IPTVChannel::IPTVChannel(TVRec *rec, const QString&) : DTVChannel(rec), m_open(false), diff --git a/mythtv/libs/libmythtv/recorders/iptvsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/iptvsignalmonitor.cpp index eb5aa53f0bd..87d49404a6e 100644 --- a/mythtv/libs/libmythtv/recorders/iptvsignalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/iptvsignalmonitor.cpp @@ -6,7 +6,8 @@ #include "iptvchannel.h" #include "mythlogging.h" -#define LOC QString("IPTVSM(%1): ").arg(channel->GetDevice()) +#define LOC QString("IPTVSM[%1](%2): ") \ + .arg(capturecardnum).arg(channel->GetDevice()) /** \brief Initializes signal lock and signal values. * diff --git a/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp b/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp index 3f735ecbe3c..4b4282f5631 100644 --- a/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/mpegrecorder.cpp @@ -46,7 +46,8 @@ extern "C" { #define IVTV_KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#define LOC QString("MPEGRec(%1): ").arg(videodevice) +#define LOC QString("MPEGRec[%1](%2): ") \ + .arg(tvrec ? tvrec->GetCaptureCardNum() : -1).arg(videodevice) const int MpegRecorder::audRateL1[] = { @@ -1367,7 +1368,7 @@ void MpegRecorder::StopEncoding(void) void MpegRecorder::InitStreamData(void) { _stream_data->AddMPEGSPListener(this); - _stream_data->SetDesiredProgram(1); + _stream_data->SetDesiredProgram(1, tvrec ? tvrec->GetCaptureCardNum() : -1); } void MpegRecorder::SetBitrate(int bitrate, int maxbitrate, diff --git a/mythtv/libs/libmythtv/recorders/recorderbase.cpp b/mythtv/libs/libmythtv/recorders/recorderbase.cpp index c7273b8ab90..e0fdccade76 100644 --- a/mythtv/libs/libmythtv/recorders/recorderbase.cpp +++ b/mythtv/libs/libmythtv/recorders/recorderbase.cpp @@ -33,8 +33,8 @@ using namespace std; #define TVREC_CARDNUM \ ((tvrec != NULL) ? QString::number(tvrec->GetCaptureCardNum()) : "NULL") -#define LOC QString("RecBase(%1:%2): ") \ - .arg(TVREC_CARDNUM).arg(videodevice) +#define LOC QString("RecBase[%1](%2): ") \ + .arg(TVREC_CARDNUM).arg(videodevice) const uint RecorderBase::kTimeOfLatestDataIntervalTarget = 5000; diff --git a/mythtv/libs/libmythtv/recorders/signalmonitor.cpp b/mythtv/libs/libmythtv/recorders/signalmonitor.cpp index 30c01cb9752..fee25b509f9 100644 --- a/mythtv/libs/libmythtv/recorders/signalmonitor.cpp +++ b/mythtv/libs/libmythtv/recorders/signalmonitor.cpp @@ -56,7 +56,8 @@ extern "C" { #undef DBG_SM #define DBG_SM(FUNC, MSG) LOG(VB_CHANNEL, LOG_DEBUG, \ - QString("SM(%1)::%2: %3").arg(channel->GetDevice()).arg(FUNC).arg(MSG)) + QString("SM[%1](%2)::%3: %4").arg(capturecardnum) \ + .arg(channel->GetDevice()).arg(FUNC).arg(MSG)) /** \class SignalMonitor * \brief Signal monitoring base class. diff --git a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp index ae19ea62186..a8f62eea7e0 100644 --- a/mythtv/libs/libmythtv/recorders/v4lchannel.cpp +++ b/mythtv/libs/libmythtv/recorders/v4lchannel.cpp @@ -28,7 +28,8 @@ using namespace std; #define DEBUG_ATTRIB 1 -#define LOC QString("V4LChannel(%1): ").arg(device) +#define LOC QString("V4LChannel[%1](%2): ") \ + .arg(GetCardID()).arg(GetDevice()) static int format_to_mode(const QString &fmt); static QString mode_to_format(int mode); diff --git a/mythtv/libs/libmythtv/recorders/v4lrecorder.cpp b/mythtv/libs/libmythtv/recorders/v4lrecorder.cpp index a16214fe119..882ab63ac4f 100644 --- a/mythtv/libs/libmythtv/recorders/v4lrecorder.cpp +++ b/mythtv/libs/libmythtv/recorders/v4lrecorder.cpp @@ -24,8 +24,8 @@ #define TVREC_CARDNUM \ ((tvrec != NULL) ? QString::number(tvrec->GetCaptureCardNum()) : "NULL") -#define LOC QString("V4LRec(%1:%2): ") \ - .arg(TVREC_CARDNUM).arg(videodevice) +#define LOC QString("V4LRec[%1](%2): ") \ + .arg(TVREC_CARDNUM).arg(videodevice) V4LRecorder::V4LRecorder(TVRec *tv) : DTVRecorder(tv), vbimode(VBIMode::None), diff --git a/mythtv/libs/libmythtv/tv_rec.cpp b/mythtv/libs/libmythtv/tv_rec.cpp index 6fc5c7f25f8..1cdfb0f523b 100644 --- a/mythtv/libs/libmythtv/tv_rec.cpp +++ b/mythtv/libs/libmythtv/tv_rec.cpp @@ -39,7 +39,7 @@ #define DEBUG_CHANNEL_PREFIX 0 /**< set to 1 to channel prefixing */ -#define LOC QString("TVRec(%1): ").arg(cardid) +#define LOC QString("TVRec[%1]: ").arg(cardid) /// How many milliseconds the signal monitor should wait between checks const uint TVRec::kSignalMonitoringRate = 50; /* msec */ @@ -3718,14 +3718,15 @@ void TVRec::TuningFrequency(const TuningRequest &request) ATSCStreamData *atsc = dynamic_cast(mpeg); if (atsc) - atsc->SetDesiredChannel(request.majorChan, request.minorChan); + atsc->SetDesiredChannel(request.majorChan, request.minorChan, + cardid); } else if (request.progNum >= 0) { channel->SetChannelByString(request.channel); if (mpeg) - mpeg->SetDesiredProgram(request.progNum); + mpeg->SetDesiredProgram(request.progNum, cardid); } }