Browse Source

Add ts_XXX_clear() functions for all objects

Georgi Chorbadzhiyski 9 years ago
parent
commit
e4d004d6d2
10 changed files with 224 additions and 77 deletions
  1. 9
    0
      tsfuncs.h
  2. 16
    7
      tsfuncs_cat.c
  3. 31
    14
      tsfuncs_eit.c
  4. 31
    14
      tsfuncs_nit.c
  5. 30
    11
      tsfuncs_pat.c
  6. 33
    12
      tsfuncs_pmt.c
  7. 12
    0
      tsfuncs_privsec.c
  8. 31
    12
      tsfuncs_sdt.c
  9. 15
    0
      tsfuncs_section_data.c
  10. 16
    7
      tsfuncs_tdt.c

+ 9
- 0
tsfuncs.h View File

@@ -86,6 +86,7 @@ uint8_t *					ts_section_data_alloc_section	();
86 86
 uint8_t *					ts_section_data_alloc_packet	();
87 87
 
88 88
 struct ts_section_header *	ts_section_data_alloc			();
89
+void						ts_section_data_clear			(struct ts_section_header *sec);
89 90
 void						ts_section_data_free			(struct ts_section_header **ts_section_header);
90 91
 
91 92
 void						ts_section_data_copy			(struct ts_section_header *src, struct ts_section_header *dst);
@@ -100,6 +101,7 @@ void						ts_section_data_gen_ts_packets	(struct ts_header *ts_header, uint8_t *
100 101
 struct ts_pat *	ts_pat_alloc		();
101 102
 struct ts_pat * ts_pat_alloc_init	(uint16_t transport_stream_id);
102 103
 struct ts_pat *	ts_pat_push_packet	(struct ts_pat *pat, uint8_t *ts_packet);
104
+void            ts_pat_clear		(struct ts_pat *pat);
103 105
 void            ts_pat_free			(struct ts_pat **pat);
104 106
 int				ts_pat_parse		(struct ts_pat *pat);
105 107
 void            ts_pat_dump			(struct ts_pat *pat);
@@ -116,6 +118,7 @@ int				ts_pat_is_same		(struct ts_pat *pat1, struct ts_pat *pat2);
116 118
 // CAT
117 119
 struct ts_cat *	ts_cat_alloc		();
118 120
 struct ts_cat *	ts_cat_push_packet	(struct ts_cat *cat, uint8_t *ts_packet);
121
+void            ts_cat_clear		(struct ts_cat *cat);
119 122
 void            ts_cat_free			(struct ts_cat **cat);
120 123
 int				ts_cat_parse		(struct ts_cat *cat);
121 124
 void            ts_cat_dump			(struct ts_cat *cat);
@@ -132,6 +135,7 @@ int				ts_get_ecm_info		(struct ts_pmt *pmt, enum CA_system CA_sys, uint16_t *CA
132 135
 struct ts_pmt *	ts_pmt_alloc		();
133 136
 struct ts_pmt * ts_pmt_alloc_init	(uint16_t org_network_id, uint16_t transport_stream_id);
134 137
 struct ts_pmt *	ts_pmt_push_packet	(struct ts_pmt *pmt, uint8_t *ts_packet);
138
+void            ts_pmt_clear		(struct ts_pmt *pmt);
135 139
 void            ts_pmt_free			(struct ts_pmt **pmt);
136 140
 int				ts_pmt_parse		(struct ts_pmt *pmt);
137 141
 void            ts_pmt_dump			(struct ts_pmt *pmt);
@@ -146,6 +150,7 @@ int				ts_pmt_is_same		(struct ts_pmt *pmt1, struct ts_pmt *pmt2);
146 150
 struct ts_nit * ts_nit_alloc		();
147 151
 struct ts_nit * ts_nit_alloc_init	(uint16_t network_id);
148 152
 struct ts_nit *	ts_nit_push_packet	(struct ts_nit *nit, uint8_t *ts_packet);
153
+void			ts_nit_clear		(struct ts_nit *nit);
149 154
 void			ts_nit_free			(struct ts_nit **nit);
150 155
 int				ts_nit_parse		(struct ts_nit *nit);
151 156
 void			ts_nit_dump			(struct ts_nit *nit);
@@ -160,6 +165,7 @@ int				ts_nit_add_service_list_descriptor			(struct ts_nit *nit, uint16_t ts_id,
160 165
 struct ts_sdt *	ts_sdt_alloc		();
161 166
 struct ts_sdt * ts_sdt_alloc_init	(uint16_t org_network_id, uint16_t transport_stream_id);
162 167
 struct ts_sdt *	ts_sdt_push_packet	(struct ts_sdt *sdt, uint8_t *ts_packet);
168
+void            ts_sdt_clear		(struct ts_sdt *sdt);
163 169
 void            ts_sdt_free			(struct ts_sdt **sdt);
164 170
 int				ts_sdt_parse		(struct ts_sdt *sdt);
165 171
 void            ts_sdt_dump			(struct ts_sdt *sdt);
@@ -175,6 +181,7 @@ struct ts_eit *	ts_eit_alloc_init_schedule	(uint16_t service_id, uint16_t transp
175 181
 
176 182
 struct ts_eit *	ts_eit_push_packet	(struct ts_eit *eit, uint8_t *ts_packet);
177 183
 
184
+void			ts_eit_clear		(struct ts_eit *eit);
178 185
 void			ts_eit_free			(struct ts_eit **eit);
179 186
 int				ts_eit_parse		(struct ts_eit *eit);
180 187
 void			ts_eit_dump			(struct ts_eit *eit);
@@ -190,6 +197,7 @@ int				ts_eit_add_extended_event_descriptor(struct ts_eit *eit, uint16_t event_i
190 197
 struct ts_tdt *	ts_tdt_alloc();
191 198
 struct ts_tdt *	ts_tdt_alloc_init	(time_t ts);
192 199
 struct ts_tdt *	ts_tot_alloc_init	(time_t ts);
200
+void			ts_tdt_clear		(struct ts_tdt *tdt);
193 201
 void			ts_tdt_free			(struct ts_tdt **tdt);
194 202
 
195 203
 int				ts_tdt_parse		(struct ts_tdt *tdt);
@@ -204,6 +212,7 @@ void			ts_tot_set_localtime_offset_sofia	(struct ts_tdt *tdt, time_t now);
204 212
 
205 213
 // Private section
206 214
 struct ts_privsec *	ts_privsec_alloc();
215
+void				ts_privsec_clear		(struct ts_privsec *pprivsec);
207 216
 void				ts_privsec_free			(struct ts_privsec **pprivsec);
208 217
 
209 218
 struct ts_privsec *	ts_privsec_push_packet	(struct ts_privsec *privsec, uint8_t *ts_packet);

+ 16
- 7
tsfuncs_cat.c View File

@@ -12,6 +12,20 @@ struct ts_cat *ts_cat_alloc() {
12 12
 	return cat;
13 13
 }
14 14
 
15
+void ts_cat_clear(struct ts_cat *cat) {
16
+	if (!cat)
17
+		return;
18
+	// save
19
+	struct ts_section_header *section_header = cat->section_header;
20
+	// free
21
+	FREE(cat->program_info);
22
+	// clear
23
+	ts_section_data_clear(section_header);
24
+	memset(cat, 0, sizeof(struct ts_cat));
25
+	// restore
26
+	cat->section_header = section_header;
27
+}
28
+
15 29
 void ts_cat_free(struct ts_cat **pcat) {
16 30
 	struct ts_cat *cat = *pcat;
17 31
 	if (cat) {
@@ -21,12 +35,6 @@ void ts_cat_free(struct ts_cat **pcat) {
21 35
 	}
22 36
 }
23 37
 
24
-static struct ts_cat *ts_cat_reset(struct ts_cat *cat) {
25
-	struct ts_cat *newcat = ts_cat_alloc();
26
-	ts_cat_free(&cat);
27
-	return newcat;
28
-}
29
-
30 38
 struct ts_cat *ts_cat_push_packet(struct ts_cat *cat, uint8_t *ts_packet) {
31 39
 	struct ts_header ts_header;
32 40
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -67,7 +75,8 @@ OUT:
67 75
 	return cat;
68 76
 
69 77
 ERROR:
70
-	return ts_cat_reset(cat);
78
+	ts_cat_clear(cat);
79
+	return cat;
71 80
 }
72 81
 
73 82
 int ts_cat_parse(struct ts_cat *cat) {

+ 31
- 14
tsfuncs_eit.c View File

@@ -14,28 +14,44 @@ struct ts_eit *ts_eit_alloc() {
14 14
 	return eit;
15 15
 }
16 16
 
17
+static void ts_eit_streams_data_free(struct ts_eit *eit) {
18
+	int i;
19
+	for (i=0;i<eit->streams_num;i++) {
20
+		if (eit->streams[i]) {
21
+			FREE(eit->streams[i]->descriptor_data);
22
+			FREE(eit->streams[i]);
23
+		}
24
+	}
25
+}
26
+
27
+void ts_eit_clear(struct ts_eit *eit) {
28
+	if (!eit)
29
+		return;
30
+	// save
31
+	struct ts_section_header *section_header = eit->section_header;
32
+	struct ts_eit_stream **streams = eit->streams;
33
+	int streams_max = eit->streams_max;
34
+	// free
35
+	ts_eit_streams_data_free(eit);
36
+	// clear
37
+	ts_section_data_clear(section_header);
38
+	memset(eit, 0, sizeof(struct ts_eit));
39
+	// restore
40
+	eit->section_header = section_header;
41
+	eit->streams = streams;
42
+	eit->streams_max = streams_max;
43
+}
44
+
17 45
 void ts_eit_free(struct ts_eit **peit) {
18 46
 	struct ts_eit *eit = *peit;
19 47
 	if (eit) {
20
-		int i;
21 48
 		ts_section_data_free(&eit->section_header);
22
-		for (i=0;i<eit->streams_num;i++) {
23
-			if (eit->streams[i]) {
24
-				FREE(eit->streams[i]->descriptor_data);
25
-				FREE(eit->streams[i]);
26
-			}
27
-		}
49
+		ts_eit_streams_data_free(eit);
28 50
 		FREE(eit->streams);
29 51
 		FREE(*peit);
30 52
 	}
31 53
 }
32 54
 
33
-static struct ts_eit *ts_eit_reset(struct ts_eit *eit) {
34
-	struct ts_eit *neweit = ts_eit_alloc();
35
-	ts_eit_free(&eit);
36
-	return neweit;
37
-}
38
-
39 55
 struct ts_eit *ts_eit_push_packet(struct ts_eit *eit, uint8_t *ts_packet) {
40 56
 	struct ts_header ts_header;
41 57
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -80,7 +96,8 @@ OUT:
80 96
 	return eit;
81 97
 
82 98
 ERROR:
83
-	return ts_eit_reset(eit);
99
+	ts_eit_clear(eit);
100
+	return eit;
84 101
 }
85 102
 
86 103
 

+ 31
- 14
tsfuncs_nit.c View File

@@ -14,29 +14,45 @@ struct ts_nit *ts_nit_alloc() {
14 14
 	return nit;
15 15
 }
16 16
 
17
+static void ts_nit_streams_data_free(struct ts_nit *nit) {
18
+	int i;
19
+	for (i=0;i<nit->streams_num;i++) {
20
+		if (nit->streams[i]) {
21
+			FREE(nit->streams[i]->descriptor_data);
22
+			FREE(nit->streams[i]);
23
+		}
24
+	}
25
+}
26
+
27
+void ts_nit_clear(struct ts_nit *nit) {
28
+	if (!nit)
29
+		return;
30
+	// save
31
+	struct ts_section_header *section_header = nit->section_header;
32
+	struct ts_nit_stream **streams = nit->streams;
33
+	int streams_max = nit->streams_max;
34
+	// free
35
+	ts_nit_streams_data_free(nit);
36
+	// clear
37
+	ts_section_data_clear(section_header);
38
+	memset(nit, 0, sizeof(struct ts_nit));
39
+	// restore
40
+	nit->section_header = section_header;
41
+	nit->streams = streams;
42
+	nit->streams_max = streams_max;
43
+}
44
+
17 45
 void ts_nit_free(struct ts_nit **pnit) {
18 46
 	struct ts_nit *nit = *pnit;
19
-	int i;
20 47
 	if (nit) {
21 48
 		ts_section_data_free(&nit->section_header);
22 49
 		FREE(nit->network_info);
23
-		for (i=0;i<nit->streams_num;i++) {
24
-			if (nit->streams[i]) {
25
-				FREE(nit->streams[i]->descriptor_data);
26
-				FREE(nit->streams[i]);
27
-			}
28
-		}
50
+		ts_nit_streams_data_free(nit);
29 51
 		FREE(nit->streams);
30 52
 		FREE(*pnit);
31 53
 	}
32 54
 }
33 55
 
34
-static struct ts_nit *ts_nit_reset(struct ts_nit *nit) {
35
-	struct ts_nit *newnit = ts_nit_alloc();
36
-	ts_nit_free(&nit);
37
-	return newnit;
38
-}
39
-
40 56
 struct ts_nit *ts_nit_push_packet(struct ts_nit *nit, uint8_t *ts_packet) {
41 57
 	struct ts_header ts_header;
42 58
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -78,7 +94,8 @@ OUT:
78 94
 	return nit;
79 95
 
80 96
 ERROR:
81
-	return ts_nit_reset(nit);
97
+	ts_nit_clear(nit);
98
+	return nit;
82 99
 }
83 100
 
84 101
 

+ 30
- 11
tsfuncs_pat.c View File

@@ -14,25 +14,43 @@ struct ts_pat *ts_pat_alloc() {
14 14
 	return pat;
15 15
 }
16 16
 
17
+static void ts_pat_programs_data_free(struct ts_pat *pat) {
18
+	int i;
19
+	for (i=0;i<pat->programs_num;i++) {
20
+		if (pat->programs[i]) {
21
+			FREE(pat->programs[i]);
22
+		}
23
+	}
24
+}
25
+
26
+void ts_pat_clear(struct ts_pat *pat) {
27
+	if (!pat)
28
+		return;
29
+	// save
30
+	struct ts_section_header *section_header = pat->section_header;
31
+	struct ts_pat_program **programs = pat->programs;
32
+	int programs_max = pat->programs_max;
33
+	// free
34
+	ts_pat_programs_data_free(pat);
35
+	// clear
36
+	ts_section_data_clear(section_header);
37
+	memset(pat, 0, sizeof(struct ts_pat));
38
+	// restore
39
+	pat->section_header = section_header;
40
+	pat->programs = programs;
41
+	pat->programs_max = programs_max;
42
+}
43
+
17 44
 void ts_pat_free(struct ts_pat **ppat) {
18 45
 	struct ts_pat *pat = *ppat;
19
-	int i;
20 46
 	if (pat) {
21 47
 		ts_section_data_free(&pat->section_header);
22
-		for (i=0;i<pat->programs_num;i++) {
23
-			FREE(pat->programs[i]);
24
-		}
48
+		ts_pat_programs_data_free(pat);
25 49
 		FREE(pat->programs);
26 50
 		FREE(*ppat);
27 51
 	}
28 52
 }
29 53
 
30
-static struct ts_pat *ts_pat_reset(struct ts_pat *pat) {
31
-	struct ts_pat *newpat = ts_pat_alloc();
32
-	ts_pat_free(&pat);
33
-	return newpat;
34
-}
35
-
36 54
 struct ts_pat *ts_pat_push_packet(struct ts_pat *pat, uint8_t *ts_packet) {
37 55
 	struct ts_header ts_header;
38 56
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -76,7 +94,8 @@ OUT:
76 94
 	return pat;
77 95
 
78 96
 ERROR:
79
-	return ts_pat_reset(pat);
97
+	ts_pat_clear(pat);
98
+	return pat;
80 99
 }
81 100
 
82 101
 int ts_pat_parse(struct ts_pat *pat) {

+ 33
- 12
tsfuncs_pmt.c View File

@@ -14,27 +14,47 @@ struct ts_pmt *ts_pmt_alloc() {
14 14
 	return pmt;
15 15
 }
16 16
 
17
+static void ts_pmt_streams_data_free(struct ts_pmt *pmt) {
18
+	int i;
19
+	for (i=0;i<pmt->streams_num;i++) {
20
+		if (pmt->streams[i]) {
21
+			FREE(pmt->streams[i]->ES_info);
22
+			FREE(pmt->streams[i]);
23
+		}
24
+	}
25
+}
26
+
27
+void ts_pmt_clear(struct ts_pmt *pmt) {
28
+	if (!pmt)
29
+		return;
30
+	// save
31
+	struct ts_section_header *section_header = pmt->section_header;
32
+	struct ts_pmt_stream **streams = pmt->streams;
33
+	int streams_max = pmt->streams_max;
34
+	// free
35
+	FREE(pmt->program_info);
36
+	ts_pmt_streams_data_free(pmt);
37
+	// clear
38
+	ts_section_data_clear(section_header);
39
+	memset(pmt, 0, sizeof(struct ts_pmt));
40
+	// restore
41
+	pmt->section_header = section_header;
42
+	pmt->streams = streams;
43
+	pmt->streams_max = streams_max;
44
+}
45
+
46
+
17 47
 void ts_pmt_free(struct ts_pmt **ppmt) {
18 48
 	struct ts_pmt *pmt = *ppmt;
19
-	int i;
20 49
 	if (pmt) {
21 50
 		ts_section_data_free(&pmt->section_header);
22
-		for (i=0;i<pmt->streams_num;i++) {
23
-			FREE(pmt->streams[i]->ES_info);
24
-			FREE(pmt->streams[i]);
25
-		}
51
+		ts_pmt_streams_data_free(pmt);
26 52
 		FREE(pmt->program_info);
27 53
 		FREE(pmt->streams);
28 54
 		FREE(*ppmt);
29 55
 	}
30 56
 }
31 57
 
32
-static struct ts_pmt *ts_pmt_reset(struct ts_pmt *pmt) {
33
-	struct ts_pmt *newpmt = ts_pmt_alloc();
34
-	ts_pmt_free(&pmt);
35
-	return newpmt;
36
-}
37
-
38 58
 struct ts_pmt *ts_pmt_push_packet(struct ts_pmt *pmt, uint8_t *ts_packet) {
39 59
 	struct ts_header ts_header;
40 60
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -75,7 +95,8 @@ OUT:
75 95
 	return pmt;
76 96
 
77 97
 ERROR:
78
-	return ts_pmt_reset(pmt);
98
+	ts_pmt_clear(pmt);
99
+	return pmt;
79 100
 }
80 101
 
81 102
 int ts_pmt_parse(struct ts_pmt *pmt) {

+ 12
- 0
tsfuncs_privsec.c View File

@@ -13,6 +13,18 @@ struct ts_privsec *ts_privsec_alloc() {
13 13
 	return privsec;
14 14
 }
15 15
 
16
+void ts_privsec_clear(struct ts_privsec *privsec) {
17
+	if (!privsec)
18
+		return;
19
+	// save
20
+	struct ts_section_header *section_header = privsec->section_header;
21
+	// clear
22
+	ts_section_data_clear(section_header);
23
+	memset(privsec, 0, sizeof(struct ts_privsec));
24
+	// restore
25
+	privsec->section_header = section_header;
26
+}
27
+
16 28
 void ts_privsec_free(struct ts_privsec **pprivsec) {
17 29
 	struct ts_privsec *privsec = *pprivsec;
18 30
 	if (privsec) {

+ 31
- 12
tsfuncs_sdt.c View File

@@ -14,26 +14,44 @@ struct ts_sdt *ts_sdt_alloc() {
14 14
 	return sdt;
15 15
 }
16 16
 
17
+static void ts_sdt_streams_data_free(struct ts_sdt *sdt) {
18
+	int i;
19
+	for (i=0;i<sdt->streams_num;i++) {
20
+		if (sdt->streams[i]) {
21
+			FREE(sdt->streams[i]->descriptor_data);
22
+			FREE(sdt->streams[i]);
23
+		}
24
+	}
25
+}
26
+
27
+void ts_sdt_clear(struct ts_sdt *sdt) {
28
+	if (!sdt)
29
+		return;
30
+	// save
31
+	struct ts_section_header *section_header = sdt->section_header;
32
+	struct ts_sdt_stream **streams = sdt->streams;
33
+	int streams_max = sdt->streams_max;
34
+	// free
35
+	ts_sdt_streams_data_free(sdt);
36
+	// clear
37
+	ts_section_data_clear(section_header);
38
+	memset(sdt, 0, sizeof(struct ts_sdt));
39
+	// restore
40
+	sdt->section_header = section_header;
41
+	sdt->streams = streams;
42
+	sdt->streams_max = streams_max;
43
+}
44
+
17 45
 void ts_sdt_free(struct ts_sdt **psdt) {
18 46
 	struct ts_sdt *sdt = *psdt;
19
-	int i;
20 47
 	if (sdt) {
21 48
 		ts_section_data_free(&sdt->section_header);
22
-		for (i=0;i<sdt->streams_num;i++) {
23
-			FREE(sdt->streams[i]->descriptor_data);
24
-			FREE(sdt->streams[i]);
25
-		}
49
+		ts_sdt_streams_data_free(sdt);
26 50
 		FREE(sdt->streams);
27 51
 		FREE(*psdt);
28 52
 	}
29 53
 }
30 54
 
31
-static struct ts_sdt *ts_sdt_reset(struct ts_sdt *sdt) {
32
-	struct ts_sdt *newsdt = ts_sdt_alloc();
33
-	ts_sdt_free(&sdt);
34
-	return newsdt;
35
-}
36
-
37 55
 struct ts_sdt *ts_sdt_push_packet(struct ts_sdt *sdt, uint8_t *ts_packet) {
38 56
 	struct ts_header ts_header;
39 57
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -77,7 +95,8 @@ OUT:
77 95
 	return sdt;
78 96
 
79 97
 ERROR:
80
-	return ts_sdt_reset(sdt);
98
+	ts_sdt_clear(sdt);
99
+	return sdt;
81 100
 }
82 101
 
83 102
 int ts_sdt_parse(struct ts_sdt *sdt) {

+ 15
- 0
tsfuncs_section_data.c View File

@@ -27,6 +27,21 @@ struct ts_section_header *ts_section_data_alloc() {
27 27
 	return section_data;
28 28
 }
29 29
 
30
+void ts_section_data_clear(struct ts_section_header *sec) {
31
+	if (!sec)
32
+		return;
33
+	// save
34
+	uint8_t *section_data = sec->section_data;
35
+	uint8_t *packet_data = sec->packet_data;
36
+	// clear
37
+	memset(section_data, 0x30, 4096);
38
+	memset(packet_data , 0x31, 5120);
39
+	memset(sec, 0, sizeof(struct ts_section_header));
40
+	// restore
41
+	sec->section_data = section_data;
42
+	sec->packet_data  = packet_data;
43
+}
44
+
30 45
 void ts_section_data_free(struct ts_section_header **psection_data) {
31 46
 	struct ts_section_header *section_data = *psection_data;
32 47
 	if (section_data) {

+ 16
- 7
tsfuncs_tdt.c View File

@@ -13,6 +13,20 @@ struct ts_tdt *ts_tdt_alloc() {
13 13
 	return tdt;
14 14
 }
15 15
 
16
+void ts_tdt_clear(struct ts_tdt *tdt) {
17
+	if (!tdt)
18
+		return;
19
+	// save
20
+	struct ts_section_header *section_header = tdt->section_header;
21
+	// free
22
+	FREE(tdt->descriptors);
23
+	// clear
24
+	ts_section_data_clear(section_header);
25
+	memset(tdt, 0, sizeof(struct ts_tdt));
26
+	// restore
27
+	tdt->section_header = section_header;
28
+}
29
+
16 30
 void ts_tdt_free(struct ts_tdt **ptdt) {
17 31
 	struct ts_tdt *tdt = *ptdt;
18 32
 	if (tdt) {
@@ -22,12 +36,6 @@ void ts_tdt_free(struct ts_tdt **ptdt) {
22 36
 	}
23 37
 }
24 38
 
25
-static struct ts_tdt *ts_tdt_reset(struct ts_tdt *tdt) {
26
-	struct ts_tdt *newtdt = ts_tdt_alloc();
27
-	ts_tdt_free(&tdt);
28
-	return newtdt;
29
-}
30
-
31 39
 struct ts_tdt *ts_tdt_push_packet(struct ts_tdt *tdt, uint8_t *ts_packet) {
32 40
 	struct ts_header ts_header;
33 41
 	memset(&ts_header, 0, sizeof(struct ts_header));
@@ -72,7 +80,8 @@ OUT:
72 80
 	return tdt;
73 81
 
74 82
 ERROR:
75
-	return ts_tdt_reset(tdt);
83
+	ts_tdt_clear(tdt);
84
+	return tdt;
76 85
 }
77 86
 
78 87
 int ts_tdt_parse(struct ts_tdt *tdt) {

Loading…
Cancel
Save