Permalink
Browse files

Refs #10712. Add error checking, proper formatting, and improve debug…

…ging of previous commit.
  • Loading branch information...
daniel-kristjansson committed May 28, 2012
1 parent 810b3af commit 98d02dbe1e6a58ea18fbdb97659a52129c8529a4
Showing with 21 additions and 6 deletions.
  1. +3 −1 mythtv/libs/libmythtv/dtvmultiplex.cpp
  2. +18 −5 mythtv/libs/libmythtv/hdhrstreamhandler.cpp
@@ -320,7 +320,9 @@ bool DTVMultiplex::ParseTuningParams(
if (DTVTunerType::kTunerTypeATSC == type)
return ParseATSC(_frequency, _modulation);
- LOG(VB_GENERAL, LOG_ERR, LOC + QString("ParseTuningParams -- Unknown tuner type = 0x%1").arg(type, 8, 16, QChar('0')));
+ LOG(VB_GENERAL, LOG_ERR, LOC +
+ QString("ParseTuningParams -- Unknown tuner type = 0x%1")
+ .arg(type,0,16,QChar('0')));
return false;
}
@@ -271,18 +271,31 @@ bool HDHRStreamHandler::Open(void)
_tuner_types.clear();
if (QString(model).toLower().contains("cablecard"))
{
+ QString status_channel = "none";
hdhomerun_tuner_status_t t_status;
- hdhomerun_device_get_oob_status(_hdhomerun_device, NULL, &t_status);
- LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("Cable card OOB channel is '%1'").arg(t_status.channel));
- if (strcmp(t_status.channel, "none") == 0)
+ if (hdhomerun_device_get_oob_status(
+ _hdhomerun_device, NULL, &t_status) < 0)
{
- LOG(VB_GENERAL, LOG_INFO, LOC + "Cable card is not present");
+ LOG(VB_GENERAL, LOG_ERR, LOC +
+ "Failed to query Cable card OOB channel");
+ }
+ else
+ {
+ status_channel = QString(t_status.channel);
+ LOG(VB_RECORD, LOG_INFO, LOC +
+ QString("Cable card OOB channel is '%1'")
+ .arg(status_channel));
+ }
+
+ if (status_channel == "none")
+ {
+ LOG(VB_RECORD, LOG_INFO, LOC + "Cable card is not present");
_tuner_types.push_back(DTVTunerType::kTunerTypeATSC);
}
else
{
- LOG(VB_GENERAL, LOG_INFO, LOC + "Cable card is present");
+ LOG(VB_RECORD, LOG_INFO, LOC + "Cable card is present");
_tuner_types.push_back(DTVTunerType::kTunerTypeOCUR);
}
}

0 comments on commit 98d02db

Please sign in to comment.