|
@@ -128,9 +128,10 @@ static void decode_buffer(struct ts *ts, uint8_t *data, int data_len) {
|
128
|
128
|
for (i = 0; i < batch_sz; i++) {
|
129
|
129
|
uint8_t *ts_packet = data + (i * 188);
|
130
|
130
|
|
131
|
|
- int scramble_idx = ts_packet_get_scrambled(ts_packet);
|
132
|
|
- if (scramble_idx > 1) {
|
|
131
|
+ uint16_t pid = ts_packet_get_pid(ts_packet);
|
|
132
|
+ if (pidmap_get(&ts->pidmap, pid) && ts_packet_is_scrambled(ts_packet)) {
|
133
|
133
|
if (ts->key.is_valid_cw) {
|
|
134
|
+ int scramble_idx = ts_packet_get_scrambled(ts_packet);
|
134
|
135
|
uint8_t payload_ofs = ts_packet_get_payload_offset(ts_packet);
|
135
|
136
|
if (scramble_idx == 2) { // scramble_idx 2 == even key
|
136
|
137
|
even_pcks[even_packets].data = ts_packet + payload_ofs;
|
|
@@ -366,9 +367,11 @@ void process_packets(struct ts *ts, uint8_t *data, ssize_t data_len) {
|
366
|
367
|
}
|
367
|
368
|
}
|
368
|
369
|
} else {
|
369
|
|
- decode_packet(ts, ts_packet);
|
|
370
|
+ int allowed_pid = pidmap_get(&ts->pidmap, pid);
|
|
371
|
+ if (allowed_pid) // PAT or allowed PIDs
|
|
372
|
+ decode_packet(ts, ts_packet);
|
370
|
373
|
if (ts->pid_filter) {
|
371
|
|
- if (pidmap_get(&ts->pidmap, pid)) // PAT or allowed PIDs
|
|
374
|
+ if (allowed_pid) // PAT or allowed PIDs
|
372
|
375
|
output_write(ts, ts_packet, 188);
|
373
|
376
|
} else {
|
374
|
377
|
output_write(ts, ts_packet, 188);
|