summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-01-03 14:28:33 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-01-03 14:28:33 +0100
commitfc3b402d430f513635edaf2f7ee7ab5b32a3247f (patch)
tree40a6615566bfe150601887de7db0b8328adef778 /eit.c
parent56627cd12d9e01379d9104300fec837a4db8df48 (diff)
downloadvdr-fc3b402d430f513635edaf2f7ee7ab5b32a3247f.tar.gz
vdr-fc3b402d430f513635edaf2f7ee7ab5b32a3247f.tar.bz2
Implemented handling the "Parental Rating Descriptor"
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/eit.c b/eit.c
index e7e34dc4..15a2ac62 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
*
- * $Id: eit.c 2.8 2010/01/03 11:18:56 kls Exp $
+ * $Id: eit.c 2.9 2010/01/03 13:39:48 kls Exp $
*/
#include "eit.h"
@@ -167,7 +167,26 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
pEvent->SetContents(Contents);
}
break;
- case SI::ParentalRatingDescriptorTag:
+ case SI::ParentalRatingDescriptorTag: {
+ int LanguagePreferenceRating = -1;
+ SI::ParentalRatingDescriptor *prd = (SI::ParentalRatingDescriptor *)d;
+ SI::ParentalRatingDescriptor::Rating Rating;
+ for (SI::Loop::Iterator it3; prd->ratingLoop.getNext(Rating, it3); ) {
+ if (I18nIsPreferredLanguage(Setup.EPGLanguages, Rating.languageCode, LanguagePreferenceRating)) {
+ int ParentalRating = (Rating.getRating() & 0xFF);
+ switch (ParentalRating) {
+ // values defined by the DVB standard (minimum age = rating + 3 years):
+ case 0x01 ... 0x0F: ParentalRating += 3; break;
+ // values defined by broadcaster CSAT (now why didn't they just use 0x07, 0x09 and 0x0D?):
+ case 0x11: ParentalRating = 10; break;
+ case 0x12: ParentalRating = 12; break;
+ case 0x13: ParentalRating = 16; break;
+ default: ParentalRating = 0;
+ }
+ pEvent->SetParentalRating(ParentalRating);
+ }
+ }
+ }
break;
case SI::PDCDescriptorTag: {
SI::PDCDescriptor *pd = (SI::PDCDescriptor *)d;