src/libtsduck/dtv/tsDescriptorList.cpp
size_t ts::DescriptorList::searchLanguage(const UString& language, size_t start_index) const
{
    for (size_t index = start_index; index < _list.size(); index++) {
        if (_list[index].desc->tag() == DID_LANGUAGE) {
            // Got a language descriptor
            const uint8_t* desc = _list[index].desc->payload();
            size_t size = _list[index].desc->payloadSize();
            // The language code uses 3 bytes after the size
            if (size >= 3 && language.similar(desc, 3)) {
                return index;
            }
        }
    }

    return count(); // not found
}
//----------------------------------------------------------------------------
// Search a language descriptor for the specified language, starting at
// the specified index. Return the index of the descriptor in the list
// or count() if no such descriptor is found.
//----------------------------------------------------------------------------
Search a language descriptor for the specified language, starting at
the specified index. Return the index of the descriptor in the list
or count() if no such descriptor is found.
Search a language descriptor for the specified language starting at the specified index . Return the index of the descriptor in the list or count () if no such descriptor is found .
size_t ts::DescriptorList::searchLanguage(const UString& language, size_t start_index) const
{
    for (size_t index = start_index; index < _list.size(); index++) {
        if (_list[index].desc->tag() == DID_LANGUAGE) {
            const uint8_t* desc = _list[index].desc->payload();
            size_t size = _list[index].desc->payloadSize();
            if (size >= 3 && language.similar(desc, 3)) {
                return index;
            }
        }
    }
    return count(); 
}
size_t ts :: DescriptorList :: searchLanguage ( const UString & language , size_t start_index ) const { for ( size_t index = start_index ; index < _list . size ( ) ; index ++ ) { if ( _list [ index ] . desc -> tag ( ) == DID_LANGUAGE ) { const uint8_t * desc = _list [ index ] . desc -> payload ( ) ; size_t size = _list [ index ] . desc -> payloadSize ( ) ; if ( size >= 3 && language . similar ( desc , 3 ) ) { return index ; } } } return count ( ) ; }
Search a language descriptor for the specified language, starting at
the specified index.
Search a language descriptor for the specified language starting at the specified index .
// Got a language descriptor // The language code uses 3 bytes after the size // not found