Skip to content

Commit

Permalink
Refs #10712. Add error checking, proper formatting, and improve debug…
Browse files Browse the repository at this point in the history
…ging of previous commit.
  • Loading branch information
daniel-kristjansson committed May 28, 2012
1 parent 810b3af commit 98d02db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
4 changes: 3 additions & 1 deletion mythtv/libs/libmythtv/dtvmultiplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
23 changes: 18 additions & 5 deletions mythtv/libs/libmythtv/hdhrstreamhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 98d02db

Please sign in to comment.