summaryrefslogtreecommitdiff
path: root/eepg.h
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2012-11-23 16:24:15 +0100
committerDimitar Petrovski <dimeptr@gmail.com>2012-11-23 16:24:15 +0100
commit021190e605d10424986c616793829a7e99b3e720 (patch)
tree3bd9d25b8462073a134125d10980d6859c166ea0 /eepg.h
parente806e6ac89fa61fc6683bb14ac73d3173450226a (diff)
downloadvdr-plugin-eepg-021190e605d10424986c616793829a7e99b3e720.tar.gz
vdr-plugin-eepg-021190e605d10424986c616793829a7e99b3e720.tar.bz2
change MjdToEpochTime macro to function and use it on more locations
extract SKY qualitiy info from stream. Should be added to the event description do not send already expired events to VDR so that no cleanup is required after. changed the logic of summary handling for SKY so that no SummaryAvailable bit is required, since it can not be located from the stream implement some TODOs remove commented code
Diffstat (limited to 'eepg.h')
-rw-r--r--eepg.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/eepg.h b/eepg.h
index 8eb3f2d..a2ddb0f 100644
--- a/eepg.h
+++ b/eepg.h
@@ -57,6 +57,7 @@ typedef struct {
unsigned char Unknown2;//FIXME
unsigned char Unknown3;//FIXME
unsigned char Rating;
+ unsigned char Quality;
unsigned short int TableId;
} Title_t;
@@ -7180,4 +7181,14 @@ typedef struct { //first three bytes form unknown header, then X blocks, where X
#define HILO16( x ) ( ( ( x##High << 8 ) | x##Low ) & 0xffff )
#define HILO32( x ) ( ( ( ( ( x##High << 24 ) | ( x##MediumHigh << 16 ) ) | ( x##MediumLow << 8 ) ) | x##Low ) & 0xffffffff )
-#define MjdToEpochTime(x) (((x##_hi << 8 | x##_lo)-40587)*86400)
+//#define MjdToEpochTime(x) (((x##_hi << 8 | x##_lo)-40587)*86400)
+inline time_t MjdToEpochTime(u_short mjd, u_char Hour = 0, u_char Minute = 0, u_char Sec = 0) {
+ return ((mjd - 40587) * 86400) + ( ((((Hour & 0xf0) >> 4) * 10) + (Hour & 0x0f)) * 3600 )
+ + (((((Minute & 0xf0) >> 4) * 10) + (Minute & 0x0f)) * 60)
+ + ((((Sec & 0xf0) >> 4) * 10) + (Sec & 0x0f));
+}
+inline time_t MjdToEpochTime(u_char dateHigh, u_char dateLow, u_char Hour = 0, u_char Minute = 0,u_char Sec = 0) {
+ unsigned short mjd = HILO16(date);
+ return MjdToEpochTime(mjd, Hour, Minute, Sec);
+}
+