Browse Source

Change formatting of CA descriptors

Georgi Chorbadzhiyski 8 years ago
parent
commit
575859e751
1 changed files with 9 additions and 8 deletions
  1. 9 8
      tsfuncs_descriptors.c

+ 9 - 8
tsfuncs_descriptors.c View File

@@ -32,8 +32,6 @@ void ts_descriptor_dump(uint8_t *desc_data, int desc_data_len) {
32 32
 	int data_len = desc_data_len;
33 33
 	while (data_len >= 2) {
34 34
 		int i;
35
-		uint32_t temp_u;
36
-
37 35
 		uint8_t tag         = data[0];
38 36
 		uint8_t this_length = data[1];
39 37
 
@@ -175,12 +173,15 @@ void ts_descriptor_dump(uint8_t *desc_data, int desc_data_len) {
175 173
 				);
176 174
 				break;
177 175
 			}
178
-			case  9: { // I see this in data, so might as well "explain" it
179
-				ts_LOGf("%sTag 0x%02x (%02d), sz: %d, CA descriptor:\n", pad, tag, tag, this_length);
180
-				temp_u = (data[0] << 8) | data[1];
181
-				ts_LOGf("%sCA  id %04x (%02d)\n",pad,temp_u,temp_u);
182
-				temp_u = ((data[2] & 0x1F) << 8) | data[3];
183
-				ts_LOGf("%sCA PID %04x (%d)\n",pad,temp_u,temp_u);
176
+			case  9: { // CA descriptor
177
+				uint16_t CA_ID = (data[0] << 8) | data[1];
178
+				uint16_t CA_PID = ((data[2] & 0x1F) << 8) | data[3];
179
+				ts_LOGf("%sTag 0x%02x (%02d), sz: %d, CA descriptor: CAID 0x%04x (%02d) | CA PID 0x%04x (%d)\n",
180
+					pad,
181
+					tag, tag,
182
+					this_length,
183
+					CA_ID, CA_ID,
184
+					CA_PID, CA_PID);
184 185
 				break;
185 186
 			}
186 187
 			case 10: { // We'll assume the length is a multiple of 4