From 8bab540df87c3f38369c772fd956f85cd655cf6e Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Thu, 13 Oct 2011 20:40:14 +0200 Subject: test merge branches --- dish.c | 10 ++++------ dish.h | 7 ++++--- eepg.c | 12 ++++-------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/dish.c b/dish.c index 75ea611..35bdb88 100644 --- a/dish.c +++ b/dish.c @@ -39,19 +39,17 @@ namespace SI return (unsigned int)(((chunk.val & (0xFFFFFFFF >> bitnum)) >> rightend)); } - DishDescriptor::DishDescriptor(UnimplementedDescriptor *unimplementedDesc) + DishDescriptor::DishDescriptor() { text = NULL; shortText = NULL; decompressed = NULL; - this->unimplementedDesc = unimplementedDesc; } DishDescriptor::~DishDescriptor() { delete [] decompressed; decompressed = NULL; - delete unimplementedDesc; } const char *DishDescriptor::getTheme(int contentNibleLvl2) @@ -256,10 +254,10 @@ namespace SI } - void DishDescriptor::Decompress(unsigned char Tid) + void DishDescriptor::Decompress(unsigned char Tid, CharArray data) { - const unsigned char *str = unimplementedDesc->getData().getData(); - const unsigned char *cmp = NULL; // Compressed data + const unsigned char *str = data.getData(); + const unsigned char *cmp = NULL; int length = 0; // Length of compressed data unsigned int dLength = 0; // Length of decompressed data if((str[3] & 0xFC) == 0x80){ diff --git a/dish.h b/dish.h index fb1689c..963fb42 100644 --- a/dish.h +++ b/dish.h @@ -10,6 +10,8 @@ #ifndef LIBSI_DISH_H #define LIBSI_DISH_H +#include + namespace SI { @@ -243,7 +245,7 @@ class UnimplementedDescriptor; class DishDescriptor { public: - DishDescriptor(UnimplementedDescriptor*); + DishDescriptor(); virtual ~DishDescriptor(); const char* getText(void) const { return text; } @@ -251,12 +253,11 @@ public: const char* getTheme(int contentNibleLvl2); const char* getCategory(int userNible); // Decompress the byte arrary and stores the result to a text string - void Decompress(unsigned char Tid); + void Decompress(unsigned char Tid, CharArray data); protected: const char* text; // name or description of the event const char* shortText; // usually the episode name unsigned char* decompressed; - UnimplementedDescriptor* unimplementedDesc; struct HuffmanTable { unsigned int startingAddress; diff --git a/eepg.c b/eepg.c index 5f5f52b..54ed4a6 100644 --- a/eepg.c +++ b/eepg.c @@ -3190,21 +3190,17 @@ cEIT2::cEIT2 (cSchedules * Schedules, int Source, u_char Tid, const u_char * Dat } break; case SI::DishExtendedEventDescriptorTag: { - SI::DishDescriptor *deed = new SI::DishDescriptor((SI::UnimplementedDescriptor *)d); - deed->Decompress(Tid); if (!DishExtendedEventDescriptor) { - DishExtendedEventDescriptor = deed; - d = NULL; // so that it is not deleted + DishExtendedEventDescriptor = new SI::DishDescriptor(); + DishExtendedEventDescriptor->Decompress(Tid, d->getData()); } HasExternalData = true; } break; case SI::DishShortEventDescriptorTag: { - SI::DishDescriptor *dsed = new SI::DishDescriptor((SI::UnimplementedDescriptor *)d); - dsed->Decompress(Tid); if (!DishShortEventDescriptor) { - DishShortEventDescriptor = dsed; - d = NULL; // so that it is not deleted + DishShortEventDescriptor = new SI::DishDescriptor(); + DishShortEventDescriptor->Decompress(Tid, d->getData()); } HasExternalData = true; } -- cgit v1.2.3