|
@@ -50,8 +50,12 @@ inline int ts_packet_is_scrambled(uint8_t *ts_packet) {
|
50
|
50
|
return ts_packet_get_scrambled(ts_packet) > 1;
|
51
|
51
|
}
|
52
|
52
|
|
53
|
|
-void ts_packet_set_scrambled(uint8_t *ts_packet, enum ts_scrambled_type stype) {
|
|
53
|
+inline void ts_packet_set_not_scrambled(uint8_t *ts_packet) {
|
54
|
54
|
ts_packet[3] = ts_packet[3] &~ 0xc0; // Mask top two bits (11xxxxxx)
|
|
55
|
+}
|
|
56
|
+
|
|
57
|
+void ts_packet_set_scrambled(uint8_t *ts_packet, enum ts_scrambled_type stype) {
|
|
58
|
+ ts_packet_set_not_scrambled(ts_packet);
|
55
|
59
|
if (stype == scrambled_with_even_key)
|
56
|
60
|
ts_packet[3] |= 2 << 6;
|
57
|
61
|
if (stype == scrambled_with_odd_key)
|