Browse Source

Add ts_privsec_copy()

Georgi Chorbadzhiyski 13 years ago
parent
commit
0d46245e71
2 changed files with 10 additions and 0 deletions
  1. 2
    0
      tsfuncs.h
  2. 8
    0
      tsfuncs_privsec.c

+ 2
- 0
tsfuncs.h View File

@@ -210,6 +210,8 @@ struct ts_privsec *	ts_privsec_push_packet	(struct ts_privsec *privsec, uint8_t
210 210
 int					ts_privsec_is_same		(struct ts_privsec *p1, struct ts_privsec *p2);
211 211
 void				ts_privsec_dump			(struct ts_privsec *privsec);
212 212
 
213
+void				ts_privsec_copy			(struct ts_privsec *src, struct ts_privsec *dst);
214
+
213 215
 // Time
214 216
 uint32_t		ts_time_encode_bcd	(int duration_sec);
215 217
 void			ts_time_decode_bcd	(int duration_bcd, int *duration_sec, int *hour, int *min, int *sec);

+ 8
- 0
tsfuncs_privsec.c View File

@@ -21,6 +21,14 @@ void ts_privsec_free(struct ts_privsec **pprivsec) {
21 21
 	}
22 22
 }
23 23
 
24
+void ts_privsec_copy(struct ts_privsec *src, struct ts_privsec *dst) {
25
+	if (!src || !dst)
26
+		return;
27
+	dst->ts_header = src->ts_header;
28
+	dst->initialized = src->initialized;
29
+	ts_section_data_copy(src->section_header, dst->section_header);
30
+}
31
+
24 32
 struct ts_privsec *ts_privsec_push_packet(struct ts_privsec *privsec, uint8_t *ts_packet) {
25 33
 	struct ts_header ts_header;
26 34
 	memset(&ts_header, 0, sizeof(struct ts_header));

Loading…
Cancel
Save