uint16_t pcr_pid;
};
-#define MPEGTS_DATA_CC_RESTART (1<<0)
+#define MPEGTS_DATA_CC_RESTART (1<<0)
+#define MPEGTS_DATA_REMOVE_SCRAMBLED (1<<1)
typedef int (*mpegts_table_callback_t)
( mpegts_table_t*, const uint8_t *buf, int len, int tableid );
TAILQ_HEAD(,mpegts_packet) mi_input_queue;
uint64_t mi_input_queue_size;
tvhlog_limit_t mi_input_queue_loglimit;
+ int mi_remove_scrambled_bits;
/* Data processing/output */
// Note: this lock (mi_output_lock) protects all the remaining
return 1;
}
mpegts_input_recv_packets((mpegts_input_t*)iptv_input, mmi,
- &im->mm_iptv_buffer, 0, &pcr);
+ &im->mm_iptv_buffer,
+ in->in_remove_scrambled_bits ?
+ MPEGTS_DATA_REMOVE_SCRAMBLED : 0, &pcr);
if (pcr.pcr_first != PTS_UNSET && pcr.pcr_last != PTS_UNSET) {
im->im_pcr_pid = pcr.pcr_pid;
if (im->im_pcr == PTS_UNSET) {
.set = iptv_network_class_icon_url_set,
.opts = PO_MULTILINE | PO_ADVANCED
},
+ {
+ .type = PT_BOOL,
+ .id = "remove_scrambled",
+ .name = N_("Remove scrambled bits"),
+ .desc = N_("The scrambled bits in MPEG-TS packets are always cleared. "
+ "It is a workaround for the special streams which are "
+ "descrambled, but these bits are not touched."),
+ .off = offsetof(iptv_network_t, in_remove_scrambled_bits),
+ .def.i = 1,
+ .opts = PO_EXPERT,
+ },
{
.id = "autodiscovery",
.type = PT_NONE,
int in_scan_create;
int in_priority;
int in_streaming_priority;
+ int in_remove_scrambled_bits;
uint16_t in_service_id;
.def.i = 1,
.opts = PO_ADVANCED,
},
+ {
+ .type = PT_BOOL,
+ .id = "remove_scrambled",
+ .name = N_("Remove scrambled bits"),
+ .desc = N_("The scrambled bits in MPEG-TS packets are always cleared. "
+ "It is a workaround for the special streams which are "
+ "descrambled, but these bits are not touched."),
+ .off = offsetof(mpegts_input_t, mi_remove_scrambled_bits),
+ .def.i = 1,
+ .opts = PO_EXPERT,
+ },
{
.type = PT_STR,
.id = "networks",
mp->mp_mux = mmi->mmi_mux;
mp->mp_len = len2;
mp->mp_cc_restart = (flags & MPEGTS_DATA_CC_RESTART) ? 1 : 0;
+
memcpy(mp->mp_data, tsb, len2);
+ if (mi->mi_remove_scrambled_bits || (flags & MPEGTS_DATA_REMOVE_SCRAMBLED) != 0) {
+ uint8_t *tmp, *end;
+ for (tmp = mp->mp_data, end = mp->mp_data + len2; tmp < end; tmp += 188)
+ tmp[3] &= ~0xc0;
+ }
len -= len2;
off += len2;