Browse Source

Show CA info as soon as it is detected

Georgi Chorbadzhiyski 13 years ago
parent
commit
06aec8866e
1 changed files with 7 additions and 8 deletions
  1. 7
    8
      tsdecrypt.c

+ 7
- 8
tsdecrypt.c View File

@@ -390,8 +390,14 @@ int main(int argc, char **argv) {
390 390
 		if (pid && pid == pmt_pid) {
391 391
 			pmt = ts_pmt_push_packet(pmt, ts_packet, pmt_pid);
392 392
 			if (pmt->initialized) {
393
-				if (req_CA_sys != CA_UNKNOWN)
393
+				if (req_CA_sys != CA_UNKNOWN && !ecm_caid) {
394 394
 					ts_get_ecm_info(pmt, req_CA_sys, &ecm_caid, &ecm_pid);
395
+					char *CA_sys = ts_get_CA_sys_txt(ts_get_CA_sys(emm_caid));
396
+					printf("%s Service : 0x%04x\n", CA_sys, service_id);
397
+					printf("%s CA_id   : 0x%04x\n", CA_sys, emm_caid);
398
+					printf("%s EMM pid : 0x%04x\n", CA_sys, emm_pid);
399
+					printf("%s ECM pid : 0x%04x\n", CA_sys, ecm_pid);
400
+				}
395 401
 				ts_pmt_free(&pmt);
396 402
 				pmt = ts_pmt_alloc();
397 403
 			}
@@ -464,13 +470,6 @@ int main(int argc, char **argv) {
464 470
 	ts_privsec_free(&last_emm);
465 471
 	ts_privsec_free(&last_ecm);
466 472
 
467
-	if (emm_caid) {
468
-		char *CA_sys = ts_get_CA_sys_txt(ts_get_CA_sys(emm_caid));
469
-		printf("%s PRG_id  : 0x%04x\n", CA_sys, program_id);
470
-		printf("%s CA_id   : 0x%04x\n", CA_sys, emm_caid);
471
-		printf("%s EMM pid : 0x%04x\n", CA_sys, emm_pid);
472
-		printf("%s ECM pid : 0x%04x\n", CA_sys, ecm_pid);
473
-	}
474 473
 
475 474
 	exit(0);
476 475
 }

Loading…
Cancel
Save