|
@@ -1,5 +1,7 @@
|
1
|
1
|
#include "tsfuncs.h"
|
2
|
2
|
|
|
3
|
+#define NOW 1234567890
|
|
4
|
+
|
3
|
5
|
void ts_pat_test() {
|
4
|
6
|
struct ts_pat *pat = ts_pat_alloc_init(0x7878);
|
5
|
7
|
|
|
@@ -47,13 +49,13 @@ int ts_sdt_test() {
|
47
|
49
|
void ts_eit_test1(struct ts_eit *eit) { // Exactly one TS packet (188 bytes)
|
48
|
50
|
//int ts_eit_add_short_event_descriptor(struct ts_eit *eit, uint16_t event_id, uint8_t running, time_t start_time, int duration_sec, char *event_name, char *event_short_descr) {
|
49
|
51
|
|
50
|
|
- ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600,
|
|
52
|
+ ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600,
|
51
|
53
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
52
|
54
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****");
|
53
|
55
|
}
|
54
|
56
|
|
55
|
57
|
void ts_eit_test2(struct ts_eit *eit) { // One TS packet + 2 bytes (2 bytes of the CRC are in the next packet
|
56
|
|
- ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600,
|
|
58
|
+ ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600,
|
57
|
59
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
58
|
60
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy**");
|
59
|
61
|
}
|
|
@@ -62,22 +64,22 @@ void ts_eit_test3(struct ts_eit *eit) { // Test 4096 PSI packet
|
62
|
64
|
int i;
|
63
|
65
|
for (i=0;i<15;i++) {
|
64
|
66
|
// Maximum descriptor size, 255 bytes
|
65
|
|
- if (ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") != 1) {
|
|
67
|
+ if (ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") != 1) {
|
66
|
68
|
break;
|
67
|
69
|
}
|
68
|
70
|
}
|
69
|
|
- ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600, "00000000000000000000000", "1111111111111111111111111111111");
|
|
71
|
+ ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600, "00000000000000000000000", "1111111111111111111111111111111");
|
70
|
72
|
}
|
71
|
73
|
|
72
|
74
|
void ts_eit_test4(struct ts_eit *eit) { // Test almost full PSI packet on the TS packet boundary
|
73
|
75
|
int i;
|
74
|
76
|
for (i=0;i<15;i++) {
|
75
|
77
|
// Maximum descriptor size, 255 bytes
|
76
|
|
- if (ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") != 1) {
|
|
78
|
+ if (ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600, "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") != 1) {
|
77
|
79
|
break;
|
78
|
80
|
}
|
79
|
81
|
}
|
80
|
|
- ts_eit_add_short_event_descriptor(eit, 4, 1, time(NULL), 3600, "aaaaaaaaBBBB", NULL);
|
|
82
|
+ ts_eit_add_short_event_descriptor(eit, 4, 1, NOW, 3600, "aaaaaaaaBBBB", NULL);
|
81
|
83
|
}
|
82
|
84
|
|
83
|
85
|
void ts_eit_test() {
|