diff --git a/mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp b/mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp
index bcaa70f319..1039d9168a 100644
a
|
b
|
bool cCiDateTime::SendDateTime(void) |
1142 | 1142 | int L = (M == 1 || M == 2) ? 1 : 0; |
1143 | 1143 | int MJD = 14956 + D + int((Y - L) * 365.25) + int((M + 1 + L * 12) * 30.6001); |
1144 | 1144 | #define DEC2BCD(d) (uint8_t((((d) / 10) << 4) + ((d) % 10))) |
1145 | | struct tTime { unsigned short mjd; uint8_t h, m, s; short offset; }; |
1146 | | tTime T; |
1147 | | T.mjd = htons(MJD); |
1148 | | T.h = DEC2BCD(tm_gmt.tm_hour); |
1149 | | T.m = DEC2BCD(tm_gmt.tm_min); |
1150 | | T.s = DEC2BCD(tm_gmt.tm_sec); |
1151 | | T.offset = static_cast<short>(htons(tm_loc.tm_gmtoff / 60)); |
| 1145 | #define BYTE0(a) ((a) & 0xFF) |
| 1146 | #define BYTE1(a) (((a) >> 8) & 0xFF) |
| 1147 | uint8_t T[7]; |
| 1148 | uint16_t mjd = htons(MJD); |
| 1149 | int16_t local_offset = htons(tm_loc.tm_gmtoff / 60); |
| 1150 | T[0] = BYTE0(mjd); |
| 1151 | T[1] = BYTE1(mjd); |
| 1152 | T[2] = DEC2BCD(tm_gmt.tm_hour); |
| 1153 | T[3] = DEC2BCD(tm_gmt.tm_min); |
| 1154 | T[4] = DEC2BCD(tm_gmt.tm_sec); |
| 1155 | T[5] = BYTE0(local_offset); |
| 1156 | T[6] = BYTE1(local_offset); |
1152 | 1157 | |
1153 | 1158 | dbgprotocol("%d: ==> Date Time\n", SessionId()); |
1154 | | SendData(AOT_DATE_TIME, 7, (uint8_t*)&T); |
| 1159 | SendData(AOT_DATE_TIME, 7, T); |
1155 | 1160 | //XXX return value of all SendData() calls??? |
1156 | 1161 | return true; |
1157 | 1162 | } |