aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-06-08 22:54:18 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-06-08 22:54:18 +0200
commitaece969ad2b26fb6827f6c8d53622a67522f46b4 (patch)
tree3075d17dc76613c44d153cf4d61e3a3756f87817
parente26b2adba2dad6e9c25196d841657d31e4f21046 (diff)
downloadenigma2-aece969ad2b26fb6827f6c8d53622a67522f46b4.tar.gz
enigma2-aece969ad2b26fb6827f6c8d53622a67522f46b4.zip
dvbtime.h/cpp: add possibility to build a 16bit hash with event start time and month day
-rw-r--r--lib/dvb/dvbtime.cpp7
-rw-r--r--lib/dvb/dvbtime.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/dvb/dvbtime.cpp b/lib/dvb/dvbtime.cpp
index a6830dc0..bb6b94b0 100644
--- a/lib/dvb/dvbtime.cpp
+++ b/lib/dvb/dvbtime.cpp
@@ -67,7 +67,7 @@ time_t getRTC()
return rtc_time != prev_time ? rtc_time : 0;
}
-time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5)
+time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5, __u16 *hash)
{
tm t;
t.tm_sec=fromBCD(t5);
@@ -87,6 +87,11 @@ time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5)
t.tm_isdst = 0;
t.tm_gmtoff = 0;
+ if (hash) {
+ *hash = t.tm_hour * 60 + t.tm_min;
+ *hash |= t.tm_mday << 11;
+ }
+
return timegm(&t);
}
diff --git a/lib/dvb/dvbtime.h b/lib/dvb/dvbtime.h
index 3afff75e..c49e67e3 100644
--- a/lib/dvb/dvbtime.h
+++ b/lib/dvb/dvbtime.h
@@ -25,7 +25,7 @@ inline int toBCD(int dec)
return int(dec/10)*0x10 + dec%10;
}
-time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5);
+time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5, __u16 *hash=0);
class TDT: public eGTable
{