Browse Source

Try to fix a problem when stream goes from no program to properly decrypted

Without this fix "CODE_WORD_OK" message was not sent.
Georgi Chorbadzhiyski 7 years ago
parent
commit
8984be49a8
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      tsdecrypt.c

+ 7
- 4
tsdecrypt.c View File

@@ -926,10 +926,12 @@ static void do_reports(struct ts *ts) {
926 926
 		ts_LOGf("CLR | No encrypted packets in the last %ld seconds. Stream is clear.\n", now - ts->last_scrambled_packet_ts);
927 927
 		notify(ts, "STREAM_CLEAR", "No encrypted packets in the last %ld seconds. Stream is clear.", now - ts->last_scrambled_packet_ts);
928 928
 		ts->last_not_scrambled_report_ts = now;
929
-	}
930
-	if (ts->process_ecm && !ts->key.is_valid_cw) {
931
-		if (ts->cw_warn_sec && now >= ts->cw_next_warn) {
932
-			report_cw_warn(ts, now);
929
+		ts->key.is_valid_cw = 0;
930
+	} else {
931
+		if (ts->process_ecm && !ts->key.is_valid_cw) {
932
+			if (ts->cw_warn_sec && now >= ts->cw_next_warn) {
933
+				report_cw_warn(ts, now);
934
+			}
933 935
 		}
934 936
 	}
935 937
 	if (!ts->no_input) {
@@ -938,6 +940,7 @@ static void do_reports(struct ts *ts) {
938 940
 				ts_LOGf("MIS | There is no valid PMT in the input.\n");
939 941
 				notify(ts, "NO_PROGRAM", "The input is missing valid program.");
940 942
 				ts->have_valid_pmt = 0;
943
+				ts->key.is_valid_cw = 0;
941 944
 			}
942 945
 		}
943 946
 	}

Loading…
Cancel
Save