Skip to content
Permalink
Browse files

Add GetCachedSDTSections method to DVBStreamData to return all the SD…

…T sections for a given transport ID.

The current attempt to get this data in ChannelScanSM only works by accident because only the SDT sections for the current transport are available.  The method called would actually return all sections for all transport IDs.
  • Loading branch information...
peper03 committed Nov 5, 2017
1 parent 16086d2 commit aae70f3e87600781cadf1338b5e1615b2e3bb9fa
@@ -858,7 +858,7 @@ bool ChannelScanSM::UpdateChannelInfo(bool wait_until_complete)
continue;

if (!wait_until_complete || sd->HasCachedAllSDT(tsid))
m_currentInfo->sdts[tsid] = sd->GetCachedSDTs(tsid);
m_currentInfo->sdts[tsid] = sd->GetCachedSDTSections(tsid);
}
sd->ReturnCachedSDTTables(sdttmp);

@@ -746,6 +746,35 @@ sdt_const_ptr_t DVBStreamData::GetCachedSDT(
return sdt;
}

sdt_vec_t DVBStreamData::GetCachedSDTSections(uint tsid, bool current) const
{
QMutexLocker locker(&_cache_lock);

if (!current)
LOG(VB_GENERAL, LOG_WARNING, LOC +
"Currently we ignore \'current\' param");

sdt_vec_t sdts;
sdt_const_ptr_t sdt = GetCachedSDT(tsid, 0);

if (sdt)
{
uint lastSection = sdt->LastSection();

sdts.push_back(sdt);

for (uint section = 1; section <= lastSection; section++)
{
sdt = GetCachedSDT(tsid, section);

if (sdt)
sdts.push_back(sdt);
}
}

return sdts;
}

sdt_vec_t DVBStreamData::GetCachedSDTs(bool current) const
{
QMutexLocker locker(&_cache_lock);
@@ -92,6 +92,7 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData
nit_vec_t GetCachedNIT(bool current = true) const;
sdt_const_ptr_t GetCachedSDT(uint tsid, uint section_num,
bool current = true) const;
sdt_vec_t GetCachedSDTSections(uint tsid, bool current = true) const;
sdt_vec_t GetCachedSDTs(bool current = true) const;

void ReturnCachedSDTTables(sdt_vec_t&) const;

0 comments on commit aae70f3

Please sign in to comment.
You can’t perform that action at this time.