mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-04 20:28:29 +02:00
sectionsd: -add replae event if new version
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1422 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 517a305980
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-05-02 (Mon, 02 May 2011)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -66,6 +66,7 @@ SIevent::SIevent(const struct eit_event *e)
|
||||
running = (int)e->running_status;
|
||||
|
||||
table_id = 0xFF; /* not set */
|
||||
version = 0xFF;
|
||||
service_id = 0;
|
||||
original_network_id = 0;
|
||||
transport_stream_id = 0;
|
||||
@@ -79,6 +80,7 @@ SIevent::SIevent(const t_original_network_id _original_network_id, const t_trans
|
||||
service_id = _service_id;
|
||||
eventID = _event_id;
|
||||
table_id = 0xFF; /* not set */
|
||||
version = 0xFF;
|
||||
/* contentClassification = "";
|
||||
userClassification = "";
|
||||
itemDescription = "";
|
||||
@@ -109,6 +111,7 @@ SIevent::SIevent(const SIevent &e)
|
||||
running=e.running;
|
||||
vps = e.vps;
|
||||
table_id = e.table_id;
|
||||
version = e.version;
|
||||
}
|
||||
|
||||
int SIevent::saveXML(FILE *file, const char *serviceName) const
|
||||
|
@@ -354,6 +354,7 @@ public:
|
||||
eventID = 0;
|
||||
vps = 0;
|
||||
table_id = 0xFF; /* 0xFF means "not set" */
|
||||
version = 0xFF;
|
||||
// dauer=0;
|
||||
// startzeit=0;
|
||||
}
|
||||
@@ -395,6 +396,7 @@ public:
|
||||
SItimes times;
|
||||
time_t vps;
|
||||
unsigned char table_id;
|
||||
unsigned char version;
|
||||
// Der Operator zum sortieren
|
||||
bool operator < (const SIevent& e) const {
|
||||
return uniqueKey()<e.uniqueKey();
|
||||
|
@@ -504,7 +504,7 @@ void SIsectionEIT::parse(void)
|
||||
}
|
||||
|
||||
unsigned char table_id = header()->table_id;
|
||||
|
||||
unsigned char version_number = header()->version_number;
|
||||
actPos = buffer + sizeof(SI_section_EIT_header);
|
||||
bufEnd = buffer + bufferLength;
|
||||
|
||||
@@ -515,6 +515,7 @@ void SIsectionEIT::parse(void)
|
||||
e.original_network_id = original_network_id();
|
||||
e.transport_stream_id = transport_stream_id();
|
||||
e.table_id = table_id;
|
||||
e.version = version_number;
|
||||
descriptors_loop_length = sizeof(struct eit_event) + ((evt->descriptors_loop_length_hi << 8) | evt->descriptors_loop_length_lo);
|
||||
parseDescriptors(actPos, min((unsigned)(bufEnd - actPos), descriptors_loop_length), e);
|
||||
evts.insert(e);
|
||||
|
@@ -777,8 +777,12 @@ static void addEvent(const SIevent &evt, const unsigned table_id, const time_t z
|
||||
readLockEvents();
|
||||
MySIeventsOrderUniqueKey::iterator si = mySIeventsOrderUniqueKey.find(evt.uniqueKey());
|
||||
bool already_exists = (si != mySIeventsOrderUniqueKey.end());
|
||||
|
||||
if (already_exists && (evt.table_id < si->second->table_id))
|
||||
if (already_exists && ( (evt.table_id == si->second->table_id && evt.version != si->second->version) || evt.version == 0xFF || si->second->version == 0xFF ) )
|
||||
{
|
||||
//replae event if new version
|
||||
already_exists = false;
|
||||
}
|
||||
else if (already_exists && (evt.table_id < si->second->table_id))
|
||||
{
|
||||
/* if the new event has a lower (== more recent) table ID, replace the old one */
|
||||
already_exists = false;
|
||||
|
Reference in New Issue
Block a user