From 021190e605d10424986c616793829a7e99b3e720 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Fri, 23 Nov 2012 16:24:15 +0100 Subject: 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 --- eepg.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'eepg.h') 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); +} + -- cgit v1.2.3