Browse Source

Add debug level 5 (packet debug + packet dump).

Georgi Chorbadzhiyski 12 years ago
parent
commit
79c84575e6
4 changed files with 12 additions and 4 deletions
  1. 1
    0
      ChangeLog
  2. 7
    2
      process.c
  3. 3
    2
      tsdecrypt.1
  4. 1
    0
      tsdecrypt.c

+ 1
- 0
ChangeLog View File

@@ -1,4 +1,5 @@
1 1
 xxxx-xx-xx : Version -next
2
+ * Add debug level 5 (full mpeg ts packet dump).
2 3
  * Fix PSI table gathering in invalid transport streams.
3 4
  * Fix EMM/ECM parsing (this fixes ORF1 decoding on Astra 19.2).
4 5
  * Process ECMs before EMMs, preventing the case where too much

+ 7
- 2
process.c View File

@@ -66,22 +66,27 @@ static char *get_pid_desc(struct ts *ts, uint16_t pid) {
66 66
 }
67 67
 
68 68
 void show_ts_pack(struct ts *ts, uint16_t pid, char *wtf, char *extra, uint8_t *ts_packet) {
69
+	char pdump[188 * 6];
69 70
 	char cw1_dump[8 * 6];
70 71
 	char cw2_dump[8 * 6];
71 72
 	if (ts->debug_level >= 4) {
72 73
 		if (ts_pack_shown)
73 74
 			return;
75
+		if (ts->debug_level >= 5)
76
+			ts_hex_dump_buf(pdump, 188 * 6, ts_packet, 188, 0);
77
+
74 78
 		int stype = ts_packet_get_scrambled(ts_packet);
75 79
 		ts_hex_dump_buf(cw1_dump, 8 * 6, ts->key.cw    , 8, 0);
76 80
 		ts_hex_dump_buf(cw2_dump, 8 * 6, ts->key.cw + 8, 8, 0);
77
-		fprintf(stderr, "@ %s %s %03x %5ld %7ld | %s   %s | %s\n",
81
+		fprintf(stderr, "@ %s %s %03x %5ld %7ld | %s   %s | %s %s\n",
78 82
 			stype == 0 ? "------" :
79 83
 			stype == 2 ? "even 0" :
80 84
 			stype == 3 ? "odd  1" : "??????",
81 85
 			wtf,
82 86
 			pid,
83 87
 			ts_pack, ts_pack * 188,
84
-			cw1_dump, cw2_dump, extra ? extra : wtf);
88
+			cw1_dump, cw2_dump, extra ? extra : wtf,
89
+			ts->debug_level >= 5 ? pdump : "");
85 90
 	}
86 91
 }
87 92
 

+ 3
- 2
tsdecrypt.1 View File

@@ -30,8 +30,9 @@ Syslog server port. The default value is \fB514\fR.
30 30
 \fB\-D\fR, \fB\-\-debug\fR <level>
31 31
 Set message debug level. Currently there are five message levels.
32 32
 0 = default messages, 1 = show PSI tables, 2 = show EMMs 3 = show
33
-duplicate ECMs, 4 = packet debug. Setting higher level enables the
34
-levels bellow.
33
+duplicate ECMs, 4 = packet debug. 5 = packet debug + mpeg ts packet
34
+dump.
35
+Setting higher level enables the levels bellow.
35 36
 .TP
36 37
 \fB\-h\fR, \fB\-\-help\fR
37 38
 Show program help.

+ 1
- 0
tsdecrypt.c View File

@@ -157,6 +157,7 @@ static void show_help(struct ts *ts) {
157 157
 	printf("                            .    2 = show EMMs\n");
158 158
 	printf("                            .    3 = show duplicate ECMs\n");
159 159
 	printf("                            .    4 = packet debug\n");
160
+	printf("                            .    5 = packet debug + packet dump\n");
160 161
 	printf(" -h --help                  | Show help screen.\n");
161 162
 	printf(" -V --version               | Show program version.\n");
162 163
 	printf("\n");

Loading…
Cancel
Save