mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
eitd/SIevents.cpp: change SIcomponents and SIparentalRatings from set to vector -
no need to sort them, this decrease SIevent size
This commit is contained in:
@@ -176,14 +176,16 @@ void SIevent::parse(Event &event)
|
||||
std::transform(lang.begin(), lang.end(), lang.begin(), tolower);
|
||||
int table = getCountryCodeDefaultMapping(lang);
|
||||
c.component = stringDVBUTF8(d->getText(), table, tsidonid);
|
||||
components.insert(c);
|
||||
//components.insert(c);
|
||||
components.push_back(c);
|
||||
}
|
||||
else if(dtype == PARENTAL_RATING_DESCRIPTOR) {
|
||||
const ParentalRatingDescriptor *d = (ParentalRatingDescriptor*) *dit;
|
||||
const ParentalRatingList *plist = d->getParentalRatings();
|
||||
for (ParentalRatingConstIterator it = plist->begin(); it != plist->end(); ++it) {
|
||||
SIparentalRating p((*it)->getCountryCode(), (*it)->getRating());
|
||||
ratings.insert(p);
|
||||
//ratings.insert(p);
|
||||
ratings.push_back(p);
|
||||
}
|
||||
}
|
||||
else if(dtype == LINKAGE_DESCRIPTOR) {
|
||||
@@ -312,7 +314,8 @@ void SIevent::parseContentDescriptor(const uint8_t *buf, unsigned maxlen)
|
||||
void SIevent::parseComponentDescriptor(const uint8_t *buf, unsigned maxlen)
|
||||
{
|
||||
if(maxlen>=sizeof(struct descr_component_header))
|
||||
components.insert(SIcomponent((const struct descr_component_header *)buf));
|
||||
components.push_back(SIcomponent((const struct descr_component_header *)buf));
|
||||
//components.insert(SIcomponent((const struct descr_component_header *)buf));
|
||||
}
|
||||
|
||||
void SIevent::parseParentalRatingDescriptor(const uint8_t *buf, unsigned maxlen)
|
||||
@@ -322,7 +325,8 @@ void SIevent::parseParentalRatingDescriptor(const uint8_t *buf, unsigned maxlen)
|
||||
return;
|
||||
const uint8_t *s=buf+sizeof(struct descr_generic_header);
|
||||
while(s<buf+sizeof(struct descr_generic_header)+cont->descriptor_length-4) {
|
||||
ratings.insert(SIparentalRating(std::string((const char *)s, 3), *(s+3)));
|
||||
//ratings.insert(SIparentalRating(std::string((const char *)s, 3), *(s+3)));
|
||||
ratings.push_back(SIparentalRating(std::string((const char *)s, 3), *(s+3)));
|
||||
s+=4;
|
||||
}
|
||||
}
|
||||
@@ -336,7 +340,7 @@ void SIevent::parseLinkageDescriptor(const uint8_t *buf, unsigned maxlen)
|
||||
|
||||
char SIevent::getFSK() const
|
||||
{
|
||||
for (SIparentalRatings::iterator it = ratings.begin(); it != ratings.end(); ++it)
|
||||
for (SIparentalRatings::const_iterator it = ratings.begin(); it != ratings.end(); ++it)
|
||||
{
|
||||
if (it->countryCode == "DEU")
|
||||
{
|
||||
|
@@ -224,7 +224,8 @@ class SIcomponent
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::multiset <SIcomponent, std::less<SIcomponent> > SIcomponents;
|
||||
//typedef std::multiset <SIcomponent, std::less<SIcomponent> > SIcomponents;
|
||||
typedef std::vector <SIcomponent> SIcomponents;
|
||||
|
||||
// Fuer for_each
|
||||
struct printSIcomponent : public std::unary_function<class SIcomponent, void>
|
||||
@@ -272,7 +273,8 @@ class SIparentalRating
|
||||
(countryCode != p.countryCode);
|
||||
}
|
||||
};
|
||||
typedef std::set <SIparentalRating, std::less<SIparentalRating> > SIparentalRatings;
|
||||
//typedef std::set <SIparentalRating, std::less<SIparentalRating> > SIparentalRatings;
|
||||
typedef std::vector <SIparentalRating> SIparentalRatings;
|
||||
|
||||
// Fuer for_each
|
||||
struct printSIparentalRating : public std::unary_function<SIparentalRating, void>
|
||||
|
@@ -369,12 +369,17 @@ void *insertEventsfromFile(void * data)
|
||||
c.componentType = xmlGetNumericAttribute(node, "type", 16);
|
||||
c.componentTag = xmlGetNumericAttribute(node, "tag", 16);
|
||||
c.component = std::string(xmlGetAttribute(node, "text"));
|
||||
e.components.insert(c);
|
||||
//e.components.insert(c);
|
||||
e.components.push_back(c);
|
||||
node = node->xmlNextNode;
|
||||
}
|
||||
while (xmlGetNextOccurence(node, "parental_rating") != NULL) {
|
||||
#if 0
|
||||
e.ratings.insert(SIparentalRating(std::string(ZapitTools::UTF8_to_Latin1(xmlGetAttribute(node, "country"))),
|
||||
(unsigned char) xmlGetNumericAttribute(node, "rating", 10)));
|
||||
#endif
|
||||
e.ratings.push_back(SIparentalRating(std::string(ZapitTools::UTF8_to_Latin1(xmlGetAttribute(node, "country"))),
|
||||
(unsigned char) xmlGetNumericAttribute(node, "rating", 10)));
|
||||
node = node->xmlNextNode;
|
||||
}
|
||||
while (xmlGetNextOccurence(node, "linkage") != NULL) {
|
||||
|
Reference in New Issue
Block a user