sectionsd: simplify DMX::getSection code

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1408 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2011-04-17 17:36:48 +00:00
parent 102e156fc3
commit e563c2ecc4

View File

@@ -384,13 +384,14 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
return rc;
}
//find current section in list
MyDMXOrderUniqueKey::iterator di = myDMXOrderUniqueKey.find(create_sections_id(
initial_header->table_id,
// the current section
sections_id_t s_id = create_sections_id(initial_header->table_id,
eh_tbl_extension_id,
extended_header->section_number,
current_onid,
current_tsid));
current_tsid);
//find current section in list
MyDMXOrderUniqueKey::iterator di = myDMXOrderUniqueKey.find(s_id);
if (di != myDMXOrderUniqueKey.end())
{
//the current section was read before
@@ -404,22 +405,12 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
//the version number is still up2date
if (first_skipped == 0) {
//the last section was new - this is the 1st dup
first_skipped = create_sections_id(
initial_header->table_id,
eh_tbl_extension_id,
extended_header->section_number,
current_onid,
current_tsid);
first_skipped = s_id;
}
else {
//this is not the 1st new - check if it's the last
//or to be more precise only dups occured since
if (first_skipped == create_sections_id(
initial_header->table_id,
eh_tbl_extension_id,
extended_header->section_number,
current_onid,
current_tsid))
if (first_skipped == s_id)
timeouts = -1;
}
//since version is still up2date, check if table complete
@@ -453,13 +444,7 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
extended_header->section_number);
#endif
//section was not read before - insert in list
myDMXOrderUniqueKey.insert(std::make_pair(create_sections_id(
initial_header->table_id,
eh_tbl_extension_id,
extended_header->section_number,
current_onid,
current_tsid),
extended_header->version_number));
myDMXOrderUniqueKey.insert(std::make_pair(s_id, extended_header->version_number));
//check if table is now complete
if (check_complete(initial_header->table_id,
eh_tbl_extension_id,