Browse Source

Change section dump format

Georgi Chorbadzhiyski 8 years ago
parent
commit
d350e18a0b
2 changed files with 34 additions and 48 deletions
  1. 4 5
      tsfuncs_sections.c
  2. 30 43
      tstest.test.expect

+ 4 - 5
tsfuncs_sections.c View File

@@ -130,7 +130,8 @@ void ts_section_header_dump(struct ts_section_header *t) {
130 130
 		IN(t->table_id, 0x80, 0xfe) ? "user defined" :
131 131
 		t->table_id == 0xff         ? "reserved" : "Impossible!"
132 132
 	);
133
-	ts_LOGf("    - Section length     : %03x (%d)\n", t->section_length, t->section_length);
133
+	ts_LOGf("    - Section length     : %03x (%d) [num_packets:%d]\n",
134
+		t->section_length, t->section_length, t->num_packets);
134 135
 	if (!t->section_syntax_indicator) {
135 136
 		ts_LOGf("    - Private section syntax\n");
136 137
 	} else {
@@ -140,11 +141,9 @@ void ts_section_header_dump(struct ts_section_header *t) {
140 141
 				t->current_next_indicator,
141 142
 				t->section_number,
142 143
 				t->last_section_number);
143
-		ts_LOGf("    - CRC 0x%08x\n", t->CRC);
144 144
 	}
145
-	ts_LOGf("    - Private vars       : num_packets:%d section_pos:%d\n",
146
-			t->num_packets,
147
-			t->section_pos);
145
+	if (t->CRC)
146
+		ts_LOGf("    - CRC                : 0x%08x\n", t->CRC);
148 147
 }
149 148
 
150 149
 void ts_section_dump(struct ts_section_header *sec) {

+ 30 - 43
tstest.test.expect View File

@@ -2,11 +2,10 @@ PAT table
2 2
 *** tei:0 pusi:1 prio:0 pid:0000 (0) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
3 3
   * Section header
4 4
     - Table id           : 000 (0) program_association_section
5
-    - Section length     : 009 (9)
5
+    - Section length     : 009 (9) [num_packets:1]
6 6
     - TS ID / Program No : 7878 (30840)
7 7
     - Version number 1, current next 1, section number 0, last section number 0
8
-    - CRC 0xc26ec958
9
-    - Private vars       : num_packets:1 section_pos:0
8
+    - CRC                : 0xc26ec958
10 9
   * PAT data
11 10
     * num_programs: 0
12 11
    **** PAT (tspacket->struct) generator is correct ****
@@ -15,11 +14,10 @@ PAT table
15 14
 *** tei:0 pusi:1 prio:0 pid:0000 (0) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
16 15
   * Section header
17 16
     - Table id           : 000 (0) program_association_section
18
-    - Section length     : 015 (21)
17
+    - Section length     : 015 (21) [num_packets:1]
19 18
     - TS ID / Program No : 7878 (30840)
20 19
     - Version number 4, current next 1, section number 0, last section number 0
21
-    - CRC 0x89627b9e
22
-    - Private vars       : num_packets:1 section_pos:0
20
+    - CRC                : 0x89627b9e
23 21
   * PAT data
24 22
     * num_programs: 3
25 23
       * [01/03]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
@@ -32,11 +30,10 @@ PAT table
32 30
 *** tei:0 pusi:1 prio:0 pid:0000 (0) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
33 31
   * Section header
34 32
     - Table id           : 000 (0) program_association_section
35
-    - Section length     : 011 (17)
33
+    - Section length     : 011 (17) [num_packets:1]
36 34
     - TS ID / Program No : 7878 (30840)
37 35
     - Version number 5, current next 1, section number 0, last section number 0
38
-    - CRC 0x78dedb30
39
-    - Private vars       : num_packets:1 section_pos:0
36
+    - CRC                : 0x78dedb30
40 37
   * PAT data
41 38
     * num_programs: 2
42 39
       * [01/02]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
@@ -48,11 +45,10 @@ PAT table
48 45
 *** tei:0 pusi:1 prio:0 pid:0000 (0) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
49 46
   * Section header
50 47
     - Table id           : 000 (0) program_association_section
51
-    - Section length     : 00d (13)
48
+    - Section length     : 00d (13) [num_packets:1]
52 49
     - TS ID / Program No : 7878 (30840)
53 50
     - Version number 6, current next 1, section number 0, last section number 0
54
-    - CRC 0xa6a08812
55
-    - Private vars       : num_packets:1 section_pos:0
51
+    - CRC                : 0xa6a08812
56 52
   * PAT data
57 53
     * num_programs: 1
58 54
       * [01/01]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
@@ -62,11 +58,10 @@ PAT table
62 58
 *** tei:0 pusi:1 prio:0 pid:0000 (0) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
63 59
   * Section header
64 60
     - Table id           : 000 (0) program_association_section
65
-    - Section length     : 035 (53)
61
+    - Section length     : 035 (53) [num_packets:1]
66 62
     - TS ID / Program No : 7878 (30840)
67 63
     - Version number 16, current next 1, section number 0, last section number 0
68
-    - CRC 0x83076570
69
-    - Private vars       : num_packets:1 section_pos:0
64
+    - CRC                : 0x83076570
70 65
   * PAT data
71 66
     * num_programs: 11
72 67
       * [01/11]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
@@ -86,9 +81,8 @@ TDT table
86 81
 *** tei:0 pusi:1 prio:0 pid:0014 (20) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
87 82
   * Section header
88 83
     - Table id           : 070 (112) time_date_section
89
-    - Section length     : 005 (5)
84
+    - Section length     : 005 (5) [num_packets:1]
90 85
     - Private section syntax
91
-    - Private vars       : num_packets:1 section_pos:0
92 86
   * TDT data
93 87
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
94 88
     - BCD                : 0x233130 (23:31:30) check:0x233130
@@ -99,9 +93,8 @@ TDT table
99 93
 *** tei:0 pusi:1 prio:0 pid:0014 (20) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
100 94
   * Section header
101 95
     - Table id           : 070 (112) time_date_section
102
-    - Section length     : 005 (5)
96
+    - Section length     : 005 (5) [num_packets:1]
103 97
     - Private section syntax
104
-    - Private vars       : num_packets:1 section_pos:0
105 98
   * TDT data
106 99
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
107 100
     - BCD                : 0x014640 (01:46:40) check:0x014640
@@ -112,9 +105,9 @@ TOT table
112 105
 *** tei:0 pusi:1 prio:0 pid:0014 (20) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
113 106
   * Section header
114 107
     - Table id           : 073 (115) time_offset_section
115
-    - Section length     : 00b (11)
108
+    - Section length     : 00b (11) [num_packets:1]
116 109
     - Private section syntax
117
-    - Private vars       : num_packets:1 section_pos:0
110
+    - CRC                : 0x0e810add
118 111
   * TOT data
119 112
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
120 113
     - BCD                : 0x233130 (23:31:30) check:0x233130
@@ -125,9 +118,9 @@ TOT table
125 118
 *** tei:0 pusi:1 prio:0 pid:0014 (20) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
126 119
   * Section header
127 120
     - Table id           : 073 (115) time_offset_section
128
-    - Section length     : 01a (26)
121
+    - Section length     : 01a (26) [num_packets:1]
129 122
     - Private section syntax
130
-    - Private vars       : num_packets:1 section_pos:0
123
+    - CRC                : 0x0082c463
131 124
   * TOT data
132 125
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
133 126
     - BCD                : 0x233130 (23:31:30) check:0x233130
@@ -146,9 +139,9 @@ TOT table
146 139
 *** tei:0 pusi:1 prio:0 pid:0014 (20) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
147 140
   * Section header
148 141
     - Table id           : 073 (115) time_offset_section
149
-    - Section length     : 01a (26)
142
+    - Section length     : 01a (26) [num_packets:1]
150 143
     - Private section syntax
151
-    - Private vars       : num_packets:1 section_pos:0
144
+    - CRC                : 0x9bf3527e
152 145
   * TOT data
153 146
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
154 147
     - BCD                : 0x014640 (01:46:40) check:0x014640
@@ -167,11 +160,10 @@ SDT table
167 160
 *** tei:0 pusi:1 prio:0 pid:0011 (17) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
168 161
   * Section header
169 162
     - Table id           : 042 (66) service_description_section - actual_transport_stream
170
-    - Section length     : 022 (34)
163
+    - Section length     : 022 (34) [num_packets:1]
171 164
     - TS ID / Program No : 0002 (2)
172 165
     - Version number 1, current next 1, section number 0, last section number 0
173
-    - CRC 0xb29c01b7
174
-    - Private vars       : num_packets:1 section_pos:0
166
+    - CRC                : 0xb29c01b7
175 167
   * SDT data
176 168
     * PID         : 0011 (17)
177 169
     * org_net_id  : 0001 (1)
@@ -228,11 +220,10 @@ SDT table
228 220
 *** tei:0 pusi:0 prio:0 pid:0011 (17) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
229 221
   * Section header
230 222
     - Table id           : 042 (66) service_description_section - actual_transport_stream
231
-    - Section length     : fed (4077)
223
+    - Section length     : fed (4077) [num_packets:23]
232 224
     - TS ID / Program No : 0002 (2)
233 225
     - Version number 1, current next 1, section number 0, last section number 0
234
-    - CRC 0x6a25fac9
235
-    - Private vars       : num_packets:23 section_pos:0
226
+    - CRC                : 0x6a25fac9
236 227
   * SDT data
237 228
     * PID         : 0011 (17)
238 229
     * org_net_id  : 0001 (1)
@@ -535,11 +526,10 @@ CAT table
535 526
 *** tei:0 pusi:0 prio:0 pid:0012 (18) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
536 527
   * Section header
537 528
     - Table id           : 001 (1) conditional_access_section
538
-    - Section length     : 0b8 (184)
529
+    - Section length     : 0b8 (184) [num_packets:2]
539 530
     - TS ID / Program No : 0001 (1)
540 531
     - Version number 1, current next 1, section number 0, last section number 0
541
-    - CRC 0x0516db3c
542
-    - Private vars       : num_packets:2 section_pos:0
532
+    - CRC                : 0x0516db3c
543 533
   * EIT data
544 534
     * PID             : 0x0012 (18)
545 535
     * ts_stream_id    : 0x0002 (2)
@@ -563,11 +553,10 @@ CAT table
563 553
 *** tei:0 pusi:0 prio:0 pid:0012 (18) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
564 554
   * Section header
565 555
     - Table id           : 001 (1) conditional_access_section
566
-    - Section length     : 0b6 (182)
556
+    - Section length     : 0b6 (182) [num_packets:2]
567 557
     - TS ID / Program No : 0001 (1)
568 558
     - Version number 1, current next 1, section number 0, last section number 0
569
-    - CRC 0xd025e111
570
-    - Private vars       : num_packets:2 section_pos:0
559
+    - CRC                : 0xd025e111
571 560
   * EIT data
572 561
     * PID             : 0x0012 (18)
573 562
     * ts_stream_id    : 0x0002 (2)
@@ -612,11 +601,10 @@ CAT table
612 601
 *** tei:0 pusi:0 prio:0 pid:0012 (18) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
613 602
   * Section header
614 603
     - Table id           : 001 (1) conditional_access_section
615
-    - Section length     : ffd (4093)
604
+    - Section length     : ffd (4093) [num_packets:23]
616 605
     - TS ID / Program No : 0001 (1)
617 606
     - Version number 1, current next 1, section number 0, last section number 0
618
-    - CRC 0x24acd242
619
-    - Private vars       : num_packets:23 section_pos:0
607
+    - CRC                : 0x24acd242
620 608
   * EIT data
621 609
     * PID             : 0x0012 (18)
622 610
     * ts_stream_id    : 0x0002 (2)
@@ -796,11 +784,10 @@ CAT table
796 784
 *** tei:0 pusi:0 prio:0 pid:0012 (18) scramble:0 adapt:0 payload:1 adapt_len:0 adapt_flags:0 | pofs:4 plen:184
797 785
   * Section header
798 786
     - Table id           : 001 (1) conditional_access_section
799
-    - Section length     : fd3 (4051)
787
+    - Section length     : fd3 (4051) [num_packets:23]
800 788
     - TS ID / Program No : 0001 (1)
801 789
     - Version number 1, current next 1, section number 0, last section number 0
802
-    - CRC 0x50b27439
803
-    - Private vars       : num_packets:23 section_pos:0
790
+    - CRC                : 0x50b27439
804 791
   * EIT data
805 792
     * PID             : 0x0012 (18)
806 793
     * ts_stream_id    : 0x0002 (2)