diff mbox

[03/18] libdvbv5: VCT table cleanup

Message ID 1388407731-24369-3-git-send-email-neolynx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

André Roth Dec. 30, 2013, 12:48 p.m. UTC
Signed-off-by: André Roth <neolynx@gmail.com>
---
 lib/include/descriptors/vct.h  | 10 ++++++----
 lib/libdvbv5/descriptors/vct.c |  3 ++-
 2 files changed, 8 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/lib/include/descriptors/vct.h b/lib/include/descriptors/vct.h
index 6272b43..2d269dc 100644
--- a/lib/include/descriptors/vct.h
+++ b/lib/include/descriptors/vct.h
@@ -1,5 +1,6 @@ 
 /*
  * Copyright (c) 2013 - Mauro Carvalho Chehab <m.chehab@samsung.com>
+ * Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -35,14 +36,14 @@  struct dvb_table_vct_channel {
 	uint16_t	__short_name[7];
 
 	union {
-		uint16_t bitfield1;
+		uint32_t bitfield1;
 		struct {
 			uint32_t	modulation_mode:8;
 			uint32_t	minor_channel_number:10;
 			uint32_t	major_channel_number:10;
 			uint32_t	reserved1:4;
 		} __attribute__((packed));
-	};
+	} __attribute__((packed));
 
 	uint32_t	carrier_frequency;
 	uint16_t	channel_tsid;
@@ -60,7 +61,8 @@  struct dvb_table_vct_channel {
 			uint16_t	ETM_location:2;
 
 		} __attribute__((packed));
-	};
+	} __attribute__((packed));
+
 	uint16_t source_id;
 	union {
 		uint16_t bitfield3;
@@ -68,7 +70,7 @@  struct dvb_table_vct_channel {
 			uint16_t descriptors_length:10;
 			uint16_t reserved3:6;
 		} __attribute__((packed));
-	};
+	} __attribute__((packed));
 
 	/*
 	 * Everything after descriptor (including it) won't be bit-mapped
diff --git a/lib/libdvbv5/descriptors/vct.c b/lib/libdvbv5/descriptors/vct.c
index e703c52..c1578ad 100644
--- a/lib/libdvbv5/descriptors/vct.c
+++ b/lib/libdvbv5/descriptors/vct.c
@@ -1,5 +1,6 @@ 
 /*
  * Copyright (c) 2013 - Mauro Carvalho Chehab <m.chehab@samsung.com>
+ * Copyright (c) 2013 - Andre Roth <neolynx@gmail.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -74,7 +75,7 @@  void dvb_table_vct_init(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
 		bswap32(channel->carrier_frequency);
 		bswap16(channel->channel_tsid);
 		bswap16(channel->program_number);
-		bswap16(channel->bitfield1);
+		bswap32(channel->bitfield1);
 		bswap16(channel->bitfield2);
 		bswap16(channel->source_id);
 		bswap16(channel->bitfield3);