mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
sectionsd: simplify DMX::getSection code
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1408 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: e563c2ecc4
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-04-17 (Sun, 17 Apr 2011)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -384,13 +384,14 @@ int DMX::getSection(char *buf, const unsigned timeoutInMSeconds, int &timeouts)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// 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);
|
||||
//find current section in list
|
||||
MyDMXOrderUniqueKey::iterator di = myDMXOrderUniqueKey.find(create_sections_id(
|
||||
initial_header->table_id,
|
||||
eh_tbl_extension_id,
|
||||
extended_header->section_number,
|
||||
current_onid,
|
||||
current_tsid));
|
||||
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,
|
||||
|
Reference in New Issue
Block a user