[mythtv] DVB Service Description Table (SDT) handling.

roger roger at beardandsandals.co.uk
Fri Dec 16 17:42:08 UTC 2016


Ignore the last message.

I am so short sighted I missed the little 'i' in the the last for loop.

But a little documentation in the code would not go amiss.

The code is still problematic as SDT(s) are only unique within both 
transport stream ID and original network ID. But that is what I am 
trying to fix!

Roger


On 16/12/16 17:33, roger wrote:
> Hi,
>
> In a fit of madness I decided to have a look at the SDT handling in 
> DVBStreamData.cpp.
>
>
> A large portion of the code appears to be unused. But one of this bits 
> that is used is this function.
>
> bool DVBStreamData::HasCachedAllSDT(uint tsid, bool current) const
> {
>     QMutexLocker locker(&_cache_lock);
>
>     if (!current)
>         LOG(VB_GENERAL, LOG_WARNING, LOC +
>             "Currently we ignore \'current\' param");
>
>     sdt_cache_t::const_iterator it = _cached_sdts.find(tsid << 8);
>     if (it == _cached_sdts.end())
>         return false;
>
>     uint last_section = (*it)->LastSection();
>     if (!last_section)
>         return true;
>
>     for (uint i = 1; i <= last_section; i++)
>         if (_cached_sdts.find((tsid << 8) | i) == _cached_sdts.end())
>             return false;
>
>     return true;
> }
>
> Given that SDT sections are cached by this function.
>
> void DVBStreamData::CacheSDT(ServiceDescriptionTable *sdt)
> {
>     uint key = (sdt->TSID() << 8) | sdt->Section();
>
>     QMutexLocker locker(&_cache_lock);
>
>     sdt_cache_t::iterator it = _cached_sdts.find(key);
>     if (it != _cached_sdts.end())
>         DeleteCachedTable(*it);
>
>     _cached_sdts[key] = sdt;
> }
>
> Is the bit in the first function that seeks on tsid << 8 really trying 
> to find out if section zero is present?
>
> As it is at the moment it looks like the function returns true if 
> section zero is present and last section is also zero, or if section 
> zero is present and last section is not zero and that section is also 
> present. This does not really work as there are many reasons on 
> unreliable transport mechanisms such as broadcast television that 
> intervening segments may be missing.
>
> Any comment anyone.
>
> Roger
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org



More information about the mythtv-dev mailing list