Browse Source

Change section dump format

Georgi Chorbadzhiyski 13 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
 		IN(t->table_id, 0x80, 0xfe) ? "user defined" :
130
 		IN(t->table_id, 0x80, 0xfe) ? "user defined" :
131
 		t->table_id == 0xff         ? "reserved" : "Impossible!"
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
 	if (!t->section_syntax_indicator) {
135
 	if (!t->section_syntax_indicator) {
135
 		ts_LOGf("    - Private section syntax\n");
136
 		ts_LOGf("    - Private section syntax\n");
136
 	} else {
137
 	} else {
140
 				t->current_next_indicator,
141
 				t->current_next_indicator,
141
 				t->section_number,
142
 				t->section_number,
142
 				t->last_section_number);
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
 void ts_section_dump(struct ts_section_header *sec) {
149
 void ts_section_dump(struct ts_section_header *sec) {

+ 30
- 43
tstest.test.expect View File

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
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
   * Section header
3
   * Section header
4
     - Table id           : 000 (0) program_association_section
4
     - Table id           : 000 (0) program_association_section
5
-    - Section length     : 009 (9)
5
+    - Section length     : 009 (9) [num_packets:1]
6
     - TS ID / Program No : 7878 (30840)
6
     - TS ID / Program No : 7878 (30840)
7
     - Version number 1, current next 1, section number 0, last section number 0
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
   * PAT data
9
   * PAT data
11
     * num_programs: 0
10
     * num_programs: 0
12
    **** PAT (tspacket->struct) generator is correct ****
11
    **** PAT (tspacket->struct) generator is correct ****
15
 *** 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
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
   * Section header
15
   * Section header
17
     - Table id           : 000 (0) program_association_section
16
     - Table id           : 000 (0) program_association_section
18
-    - Section length     : 015 (21)
17
+    - Section length     : 015 (21) [num_packets:1]
19
     - TS ID / Program No : 7878 (30840)
18
     - TS ID / Program No : 7878 (30840)
20
     - Version number 4, current next 1, section number 0, last section number 0
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
   * PAT data
21
   * PAT data
24
     * num_programs: 3
22
     * num_programs: 3
25
       * [01/03]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
23
       * [01/03]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
32
 *** 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
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
   * Section header
31
   * Section header
34
     - Table id           : 000 (0) program_association_section
32
     - Table id           : 000 (0) program_association_section
35
-    - Section length     : 011 (17)
33
+    - Section length     : 011 (17) [num_packets:1]
36
     - TS ID / Program No : 7878 (30840)
34
     - TS ID / Program No : 7878 (30840)
37
     - Version number 5, current next 1, section number 0, last section number 0
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
   * PAT data
37
   * PAT data
41
     * num_programs: 2
38
     * num_programs: 2
42
       * [01/02]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
39
       * [01/02]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
48
 *** 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
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
   * Section header
46
   * Section header
50
     - Table id           : 000 (0) program_association_section
47
     - Table id           : 000 (0) program_association_section
51
-    - Section length     : 00d (13)
48
+    - Section length     : 00d (13) [num_packets:1]
52
     - TS ID / Program No : 7878 (30840)
49
     - TS ID / Program No : 7878 (30840)
53
     - Version number 6, current next 1, section number 0, last section number 0
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
   * PAT data
52
   * PAT data
57
     * num_programs: 1
53
     * num_programs: 1
58
       * [01/01]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
54
       * [01/01]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
62
 *** 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
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
   * Section header
59
   * Section header
64
     - Table id           : 000 (0) program_association_section
60
     - Table id           : 000 (0) program_association_section
65
-    - Section length     : 035 (53)
61
+    - Section length     : 035 (53) [num_packets:1]
66
     - TS ID / Program No : 7878 (30840)
62
     - TS ID / Program No : 7878 (30840)
67
     - Version number 16, current next 1, section number 0, last section number 0
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
   * PAT data
65
   * PAT data
71
     * num_programs: 11
66
     * num_programs: 11
72
       * [01/11]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
67
       * [01/11]: Program No 0x0001 (    1) -> PID 0100 (256) /res: 0x07/
86
 *** 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
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
   * Section header
82
   * Section header
88
     - Table id           : 070 (112) time_date_section
83
     - Table id           : 070 (112) time_date_section
89
-    - Section length     : 005 (5)
84
+    - Section length     : 005 (5) [num_packets:1]
90
     - Private section syntax
85
     - Private section syntax
91
-    - Private vars       : num_packets:1 section_pos:0
92
   * TDT data
86
   * TDT data
93
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
87
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
94
     - BCD                : 0x233130 (23:31:30) check:0x233130
88
     - BCD                : 0x233130 (23:31:30) check:0x233130
99
 *** 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
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
   * Section header
94
   * Section header
101
     - Table id           : 070 (112) time_date_section
95
     - Table id           : 070 (112) time_date_section
102
-    - Section length     : 005 (5)
96
+    - Section length     : 005 (5) [num_packets:1]
103
     - Private section syntax
97
     - Private section syntax
104
-    - Private vars       : num_packets:1 section_pos:0
105
   * TDT data
98
   * TDT data
106
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
99
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
107
     - BCD                : 0x014640 (01:46:40) check:0x014640
100
     - BCD                : 0x014640 (01:46:40) check:0x014640
112
 *** 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
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
   * Section header
106
   * Section header
114
     - Table id           : 073 (115) time_offset_section
107
     - Table id           : 073 (115) time_offset_section
115
-    - Section length     : 00b (11)
108
+    - Section length     : 00b (11) [num_packets:1]
116
     - Private section syntax
109
     - Private section syntax
117
-    - Private vars       : num_packets:1 section_pos:0
110
+    - CRC                : 0x0e810add
118
   * TOT data
111
   * TOT data
119
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
112
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
120
     - BCD                : 0x233130 (23:31:30) check:0x233130
113
     - BCD                : 0x233130 (23:31:30) check:0x233130
125
 *** 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
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
   * Section header
119
   * Section header
127
     - Table id           : 073 (115) time_offset_section
120
     - Table id           : 073 (115) time_offset_section
128
-    - Section length     : 01a (26)
121
+    - Section length     : 01a (26) [num_packets:1]
129
     - Private section syntax
122
     - Private section syntax
130
-    - Private vars       : num_packets:1 section_pos:0
123
+    - CRC                : 0x0082c463
131
   * TOT data
124
   * TOT data
132
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
125
     - MJD                : 0xd65b   (2009-02-13) unixts: 1234567890 check:0xd65b
133
     - BCD                : 0x233130 (23:31:30) check:0x233130
126
     - BCD                : 0x233130 (23:31:30) check:0x233130
146
 *** 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
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
   * Section header
140
   * Section header
148
     - Table id           : 073 (115) time_offset_section
141
     - Table id           : 073 (115) time_offset_section
149
-    - Section length     : 01a (26)
142
+    - Section length     : 01a (26) [num_packets:1]
150
     - Private section syntax
143
     - Private section syntax
151
-    - Private vars       : num_packets:1 section_pos:0
144
+    - CRC                : 0x9bf3527e
152
   * TOT data
145
   * TOT data
153
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
146
     - MJD                : 0xcbc1   (2001-09-09) unixts: 1000000000 check:0xcbc1
154
     - BCD                : 0x014640 (01:46:40) check:0x014640
147
     - BCD                : 0x014640 (01:46:40) check:0x014640
167
 *** 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
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
   * Section header
161
   * Section header
169
     - Table id           : 042 (66) service_description_section - actual_transport_stream
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
     - TS ID / Program No : 0002 (2)
164
     - TS ID / Program No : 0002 (2)
172
     - Version number 1, current next 1, section number 0, last section number 0
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
   * SDT data
167
   * SDT data
176
     * PID         : 0011 (17)
168
     * PID         : 0011 (17)
177
     * org_net_id  : 0001 (1)
169
     * org_net_id  : 0001 (1)
228
 *** 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
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
   * Section header
221
   * Section header
230
     - Table id           : 042 (66) service_description_section - actual_transport_stream
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
     - TS ID / Program No : 0002 (2)
224
     - TS ID / Program No : 0002 (2)
233
     - Version number 1, current next 1, section number 0, last section number 0
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
   * SDT data
227
   * SDT data
237
     * PID         : 0011 (17)
228
     * PID         : 0011 (17)
238
     * org_net_id  : 0001 (1)
229
     * org_net_id  : 0001 (1)
535
 *** 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
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
   * Section header
527
   * Section header
537
     - Table id           : 001 (1) conditional_access_section
528
     - Table id           : 001 (1) conditional_access_section
538
-    - Section length     : 0b8 (184)
529
+    - Section length     : 0b8 (184) [num_packets:2]
539
     - TS ID / Program No : 0001 (1)
530
     - TS ID / Program No : 0001 (1)
540
     - Version number 1, current next 1, section number 0, last section number 0
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
   * EIT data
533
   * EIT data
544
     * PID             : 0x0012 (18)
534
     * PID             : 0x0012 (18)
545
     * ts_stream_id    : 0x0002 (2)
535
     * ts_stream_id    : 0x0002 (2)
563
 *** 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
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
   * Section header
554
   * Section header
565
     - Table id           : 001 (1) conditional_access_section
555
     - Table id           : 001 (1) conditional_access_section
566
-    - Section length     : 0b6 (182)
556
+    - Section length     : 0b6 (182) [num_packets:2]
567
     - TS ID / Program No : 0001 (1)
557
     - TS ID / Program No : 0001 (1)
568
     - Version number 1, current next 1, section number 0, last section number 0
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
   * EIT data
560
   * EIT data
572
     * PID             : 0x0012 (18)
561
     * PID             : 0x0012 (18)
573
     * ts_stream_id    : 0x0002 (2)
562
     * ts_stream_id    : 0x0002 (2)
612
 *** 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
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
   * Section header
602
   * Section header
614
     - Table id           : 001 (1) conditional_access_section
603
     - Table id           : 001 (1) conditional_access_section
615
-    - Section length     : ffd (4093)
604
+    - Section length     : ffd (4093) [num_packets:23]
616
     - TS ID / Program No : 0001 (1)
605
     - TS ID / Program No : 0001 (1)
617
     - Version number 1, current next 1, section number 0, last section number 0
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
   * EIT data
608
   * EIT data
621
     * PID             : 0x0012 (18)
609
     * PID             : 0x0012 (18)
622
     * ts_stream_id    : 0x0002 (2)
610
     * ts_stream_id    : 0x0002 (2)
796
 *** 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
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
   * Section header
785
   * Section header
798
     - Table id           : 001 (1) conditional_access_section
786
     - Table id           : 001 (1) conditional_access_section
799
-    - Section length     : fd3 (4051)
787
+    - Section length     : fd3 (4051) [num_packets:23]
800
     - TS ID / Program No : 0001 (1)
788
     - TS ID / Program No : 0001 (1)
801
     - Version number 1, current next 1, section number 0, last section number 0
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
   * EIT data
791
   * EIT data
805
     * PID             : 0x0012 (18)
792
     * PID             : 0x0012 (18)
806
     * ts_stream_id    : 0x0002 (2)
793
     * ts_stream_id    : 0x0002 (2)

Loading…
Cancel
Save