Skip to content

Commit

Permalink
HDHomeRun full MPTS recording
Browse files Browse the repository at this point in the history
Change the way a full MPTS recording is implemented.
Pid 0x2000 is used to request a full transport stream.
This is how it is done in /dev/dvb drivers and the HDHomeRun
does accept that but it does then give an error message.
The range of pids is now changed to 0x0000-0x1FFF when 0x2000
is in the list of pids.
  • Loading branch information
kmdewaal committed Apr 27, 2023
1 parent 2e15fcc commit f26e5cf
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions mythtv/libs/libmythtv/recorders/hdhrstreamhandler.cpp
Expand Up @@ -453,34 +453,36 @@ QString HDHRStreamHandler::TunerSet(const QString &name, const QString &val)
return {};
}


QString valname = QString("/tuner%1/%2").arg(m_tuner).arg(name);
char *value = nullptr;
char *error = nullptr;

#if 0
LOG(VB_CHANSCAN, LOG_DEBUG, LOC + valname + " " + val);
#endif

// Receive full transport stream when pid 0x2000 is present
QString val2 = val;
if (name.contains("filter") && val.contains("0x2000"))
{
val2 = "0x0000-0x1FFF";
LOG(VB_RECORD, LOG_INFO, LOC + valname + " fixup: \"" + val + "\" to \"" +val2 + "\"");
}

if (hdhomerun_device_set_var(
m_hdhomerunDevice, valname.toLocal8Bit().constData(),
val.toLocal8Bit().constData(), &value, &error) < 0)
val2.toLocal8Bit().constData(), &value, &error) < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Set %1 to '%2' request failed").arg(valname, val) +
QString("Set %1 to '%2' request failed").arg(valname, val2) +
ENO);

return {};
}

if (error)
{
// Skip error messages from MPTS recordings
if (!(val.contains("0x2000") && strstr(error, "ERROR: invalid pid filter")))
{
LOG(VB_GENERAL, LOG_ERR, LOC + QString("DeviceSet(%1 %2): %3")
.arg(name, val, error));
}

LOG(VB_GENERAL, LOG_ERR, LOC + QString("DeviceSet(%1 %2): %3")
.arg(name, val, error));
return {};
}

Expand Down

0 comments on commit f26e5cf

Please sign in to comment.