Browse Source

Check for CW error in addition to duplicate ECM

Georgi Chorbadzhiyski 13 years ago
parent
commit
680b68f27b
2 changed files with 5 additions and 1 deletions
  1. 1
    0
      data.h
  2. 4
    1
      tables.c

+ 1
- 0
data.h View File

@@ -88,6 +88,7 @@ struct ts {
88 88
 	int					debug_level;
89 89
 
90 90
 	int					camd_stop;
91
+	int					is_cw_error;
91 92
 };
92 93
 
93 94
 enum msg_type { EMM_MSG, ECM_MSG };

+ 4
- 1
tables.c View File

@@ -123,7 +123,7 @@ void process_ecm(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
123 123
 	struct ts_header *th = &ts->ecm->ts_header;
124 124
 	struct ts_section_header *sec = ts->ecm->section_header;
125 125
 	int duplicate = ts_privsec_is_same(ts->ecm, ts->last_ecm);
126
-	if (!duplicate) {
126
+	if (!duplicate || ts->is_cw_error) {
127 127
 		ts_hex_dump_buf(dump, dump_buf_sz, sec->section_data, min(dump_sz, sec->section_data_len), 0);
128 128
 		ts_LOGf("ECM | CAID: 0x%04x PID 0x%04x Table: 0x%02x Length: %3d IDX: 0x%04x Data: %s..\n",
129 129
 			ts->ecm_caid,
@@ -132,6 +132,9 @@ void process_ecm(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
132 132
 			sec->section_data_len,
133 133
 			ts->ecm_counter,
134 134
 			dump);
135
+		if (ts->is_cw_error)
136
+			ts->ecm_counter--;
137
+		ts->is_cw_error = 0;
135 138
 		camd_msg_process(ts, camd_msg_alloc_ecm(ts->ecm_caid, ts->service_id, ts->ecm_counter++, sec->section_data, sec->section_data_len));
136 139
 	} else if (ts->debug_level >= 3) {
137 140
 		ts_LOGf("ECM | CAID: 0x%04x PID 0x%04x Table: 0x%02x Length: %3d IDX: 0x%04x Data: -dup-\n",

Loading…
Cancel
Save