From e4f666d2f8034c974271a4457cfc2a90b16c056c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 9 Apr 2011 16:35:14 +0000 Subject: [PATCH] sectionsd: add table ID to event data record the originating table ID with every event if not set (e.g. for events read from saved data), it defaults to 0xff to make sure it is bigger than a real existing table ID git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1381 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/72149b63a45f794a5b57b31679167b6c473efe9f Author: Stefan Seyfried Date: 2011-04-09 (Sat, 09 Apr 2011) --- lib/sectionsdclient/sectionsdclient.h | 2 ++ src/sectionsd/SIevents.cpp | 4 ++++ src/sectionsd/SIevents.hpp | 2 ++ src/sectionsd/SIsections.cpp | 3 +++ src/sectionsd/sectionsd.cpp | 2 ++ 5 files changed, 13 insertions(+) diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 3f0ce775b..ae876668e 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -233,6 +233,7 @@ class CEPGData std::vector itemDescriptions; std::vector items; char fsk; + unsigned char table_id; std::string contentClassification; std::string userClassification; @@ -243,6 +244,7 @@ class CEPGData info1 = ""; info2 = ""; fsk = 0; + table_id = 0xff; contentClassification = ""; userClassification = ""; }; diff --git a/src/sectionsd/SIevents.cpp b/src/sectionsd/SIevents.cpp index 34f698ef9..3287e41da 100644 --- a/src/sectionsd/SIevents.cpp +++ b/src/sectionsd/SIevents.cpp @@ -65,6 +65,7 @@ SIevent::SIevent(const struct eit_event *e) running = (int)e->running_status; + table_id = 0xFF; /* not set */ service_id = 0; original_network_id = 0; transport_stream_id = 0; @@ -77,6 +78,7 @@ SIevent::SIevent(const t_original_network_id _original_network_id, const t_trans transport_stream_id = _transport_stream_id; service_id = _service_id; eventID = _event_id; + table_id = 0xFF; /* not set */ /* contentClassification = ""; userClassification = ""; itemDescription = ""; @@ -105,6 +107,8 @@ SIevent::SIevent(const SIevent &e) ratings=e.ratings; linkage_descs=e.linkage_descs; running=e.running; + vps = e.vps; + table_id = e.table_id; } int SIevent::saveXML(FILE *file, const char *serviceName) const diff --git a/src/sectionsd/SIevents.hpp b/src/sectionsd/SIevents.hpp index c9e8eee8a..7b35408bb 100644 --- a/src/sectionsd/SIevents.hpp +++ b/src/sectionsd/SIevents.hpp @@ -353,6 +353,7 @@ public: transport_stream_id = 0; eventID = 0; vps = 0; + table_id = 0xFF; /* 0xFF means "not set" */ // dauer=0; // startzeit=0; } @@ -393,6 +394,7 @@ public: SIlinkage_descs linkage_descs; SItimes times; time_t vps; + unsigned char table_id; // Der Operator zum sortieren bool operator < (const SIevent& e) const { return uniqueKey()table_id; + actPos = buffer + sizeof(SI_section_EIT_header); bufEnd = buffer + bufferLength; @@ -512,6 +514,7 @@ void SIsectionEIT::parse(void) e.service_id = service_id(); e.original_network_id = original_network_id(); e.transport_stream_id = transport_stream_id(); + e.table_id = table_id; 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); diff --git a/src/sectionsd/sectionsd.cpp b/src/sectionsd/sectionsd.cpp index ac59b57a3..9fbb36cd0 100644 --- a/src/sectionsd/sectionsd.cpp +++ b/src/sectionsd/sectionsd.cpp @@ -9179,6 +9179,7 @@ bool sectionsd_getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData epgdata->contentClassification = std::string(evt.contentClassification.data(), evt.contentClassification.length()); epgdata->userClassification = std::string(evt.userClassification.data(), evt.userClassification.length()); epgdata->fsk = evt.getFSK(); + epgdata->table_id = evt.table_id; epgdata->epg_times.startzeit = t->startzeit; epgdata->epg_times.dauer = t->dauer; @@ -9236,6 +9237,7 @@ bool sectionsd_getActualEPGServiceKey(const t_channel_id uniqueServiceKey, CEPGD epgdata->contentClassification = std::string(evt.contentClassification.data(), evt.contentClassification.length()); epgdata->userClassification = std::string(evt.userClassification.data(), evt.userClassification.length()); epgdata->fsk = evt.getFSK(); + epgdata->table_id = evt.table_id; epgdata->epg_times.startzeit = zeit.startzeit; epgdata->epg_times.dauer = zeit.dauer;