dvbtime.h/cpp: add possibility to build a 16bit hash with event start time and month day
[enigma2.git] / lib / dvb / dvbtime.cpp
index a6830dc06aea6f37ee5e4c1d9cb23e1df9645f67..bb6b94b0d9e7207a9a77ed4ddaedf855dd59f1d8 100644 (file)
@@ -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);
 }