|
|
|
|
1
|
#include "tsfuncs.h"
|
1
|
#include "tsfuncs.h"
|
2
|
|
2
|
|
|
|
3
|
+#define NOW 1234567890
|
|
|
4
|
+
|
3
|
void ts_pat_test() {
|
5
|
void ts_pat_test() {
|
4
|
struct ts_pat *pat = ts_pat_alloc_init(0x7878);
|
6
|
struct ts_pat *pat = ts_pat_alloc_init(0x7878);
|
5
|
|
7
|
|
|
|
|
|
47
|
void ts_eit_test1(struct ts_eit *eit) { // Exactly one TS packet (188 bytes)
|
49
|
void ts_eit_test1(struct ts_eit *eit) { // Exactly one TS packet (188 bytes)
|
48
|
//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) {
|
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
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
53
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
52
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****");
|
54
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy****");
|
53
|
}
|
55
|
}
|
54
|
|
56
|
|
55
|
void ts_eit_test2(struct ts_eit *eit) { // One TS packet + 2 bytes (2 bytes of the CRC are in the next packet
|
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
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
59
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
58
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy**");
|
60
|
"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy**");
|
59
|
}
|
61
|
}
|
|
|
|
|
62
|
int i;
|
64
|
int i;
|
63
|
for (i=0;i<15;i++) {
|
65
|
for (i=0;i<15;i++) {
|
64
|
// Maximum descriptor size, 255 bytes
|
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
|
break;
|
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
|
void ts_eit_test4(struct ts_eit *eit) { // Test almost full PSI packet on the TS packet boundary
|
74
|
void ts_eit_test4(struct ts_eit *eit) { // Test almost full PSI packet on the TS packet boundary
|
73
|
int i;
|
75
|
int i;
|
74
|
for (i=0;i<15;i++) {
|
76
|
for (i=0;i<15;i++) {
|
75
|
// Maximum descriptor size, 255 bytes
|
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
|
break;
|
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
|
void ts_eit_test() {
|
85
|
void ts_eit_test() {
|