Browse Source

cat: Detect ECM pids also in stream descriptors.

Georgi Chorbadzhiyski 8 years ago
parent
commit
cdcd22dbf5
1 changed files with 13 additions and 1 deletions
  1. 13 1
      tsfuncs_cat.c

+ 13 - 1
tsfuncs_cat.c View File

@@ -219,5 +219,17 @@ int ts_get_emm_info(struct ts_cat *cat, enum CA_system req_CA_type, uint16_t *CA
219 219
 }
220 220
 
221 221
 int ts_get_ecm_info(struct ts_pmt *pmt, enum CA_system req_CA_type, uint16_t *CA_id, uint16_t *CA_pid) {
222
-	return find_CA_descriptor(pmt->program_info, pmt->program_info_size, req_CA_type, CA_id, CA_pid);
222
+	int i, result = find_CA_descriptor(pmt->program_info, pmt->program_info_size, req_CA_type, CA_id, CA_pid);
223
+	if (!result) {
224
+		for(i=0;i<pmt->streams_num;i++) {
225
+			struct ts_pmt_stream *stream = pmt->streams[i];
226
+			if (stream->ES_info) {
227
+				result = find_CA_descriptor(stream->ES_info, stream->ES_info_size, req_CA_type, CA_id, CA_pid);
228
+				if (result)
229
+					break;
230
+			}
231
+		}
232
+	}
233
+
234
+	return result;
223 235
 }