summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-01-22 09:44:30 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-01-22 09:44:30 +0100
commitc7316989f5a911796846c15ebdd7f645739fe4ad (patch)
treea7750ed5733cb5f200b682191176ffb631400da6
parentbc89bda239a233dc62f16977af68f9dba234fcd4 (diff)
downloadvdr-c7316989f5a911796846c15ebdd7f645739fe4ad.tar.gz
vdr-c7316989f5a911796846c15ebdd7f645739fe4ad.tar.bz2
Fixed a wrong alignment in cCiDateTime::SendDateTime()
-rw-r--r--HISTORY1
-rw-r--r--ci.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 107a2bbf..0be24913 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7876,3 +7876,4 @@ Video Disk Recorder Revision History
- Increased MIN_TS_PACKETS_FOR_FRAME_DETECTOR to 10 in order to be able to record
channels that need more than 5 TS packets for detecting frame borders (reported by
Eike Sauer).
+- Fixed a wrong alignment in cCiDateTime::SendDateTime().
diff --git a/ci.c b/ci.c
index 9a4a8295..fe38bc6b 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 2.12 2013/02/17 13:17:28 kls Exp $
+ * $Id: ci.c 2.12.1.1 2014/01/22 09:43:48 kls Exp $
*/
#include "ci.h"
@@ -846,7 +846,9 @@ void cCiDateTime::SendDateTime(void)
int L = (M == 1 || M == 2) ? 1 : 0;
int MJD = 14956 + D + int((Y - L) * 365.25) + int((M + 1 + L * 12) * 30.6001);
#define DEC2BCD(d) uint8_t(((d / 10) << 4) + (d % 10))
+#pragma pack(1)
struct tTime { uint16_t mjd; uint8_t h, m, s; short offset; };
+#pragma pack()
tTime T = { mjd : htons(MJD), h : DEC2BCD(tm_gmt.tm_hour), m : DEC2BCD(tm_gmt.tm_min), s : DEC2BCD(tm_gmt.tm_sec), offset : short(htons(tm_loc.tm_gmtoff / 60)) };
bool OldDumpTPDUDataTransfer = DumpTPDUDataTransfer;
DumpTPDUDataTransfer &= DumpDateTime;