.def.i = 1,
.group = 1
},
+ {
+ .type = PT_INT,
+ .id = "catimeout",
+ .name = N_("Descrambling timeout (ms)"),
+ .desc = N_("Check the descrambling status after this timeout."),
+ .off = offsetof(profile_t, pro_timeout),
+ .opts = PO_EXPERT,
+ .def.i = 2000,
+ .group = 1
+ },
+ {
+ .type = PT_BOOL,
+ .id = "swservice",
+ .name = N_("Switch to another service"),
+ .desc = N_("If something fails, try to switch to a different "
+ "service on another network. Do not try to iterate "
+ "through all inputs/tuners which are capable to "
+ "receive the service."),
+ .off = offsetof(profile_t, pro_swservice),
+ .opts = PO_EXPERT,
+ .def.i = 1,
+ .group = 1
+ },
{
.type = PT_INT,
.id = "svfilter",
lock_assert(&global_lock);
/* Build list */
- TAILQ_FOREACH(si, sil, si_link)
+ TAILQ_FOREACH(si, sil, si_link) {
si->si_mark = 1;
+ if (flags & SUBSCRIPTION_SWSERVICE) {
+ for (next = TAILQ_NEXT(si, si_link); next;
+ next = TAILQ_NEXT(next, si_link))
+ if (si->si_s == next->si_s)
+ next->si_error = si->si_error;
+ }
+ }
r = 0;
if (ch) {
th_subscription_t *s = opaque;
/* handle NO_ACCESS condition with some delay */
- if(sm->sm_code & TSS_NO_ACCESS && s->ths_service_start + sec2mono(2) < mclk())
+ if(sm->sm_code & TSS_NO_ACCESS &&
+ s->ths_service_start + sec2mono(s->ths_ca_timeout) < mclk())
mask2 |= TSS_NO_ACCESS;
if(subgetstate(s) == SUBSCRIPTION_TESTING_SERVICE) {
s->ths_flags |= SUBSCRIPTION_RESTART;
if (pro->pro_contaccess)
s->ths_flags |= SUBSCRIPTION_CONTACCESS;
+ if (pro->pro_swservice)
+ s->ths_flags |= SUBSCRIPTION_SWSERVICE;
}
+ if (pro->pro_ca_timeout)
+ s->ths_ca_timeout = ms2mono(MINMAX(pro->pro_ca_timeout, 100, 5000));
+ else
+ s->ths_ca_timeout = sec2mono(2);
+
time(&s->ths_start);
s->ths_id = ++tally;
extern struct th_subscription_list subscriptions;
-#define SUBSCRIPTION_NONE 0x000
-#define SUBSCRIPTION_MPEGTS 0x001
-#define SUBSCRIPTION_PACKET 0x002
-#define SUBSCRIPTION_TYPE_MASK 0x00f
-#define SUBSCRIPTION_STREAMING 0x010
-#define SUBSCRIPTION_RESTART 0x020
-#define SUBSCRIPTION_CONTACCESS 0x040
-#define SUBSCRIPTION_ONESHOT 0x080
-#define SUBSCRIPTION_TABLES 0x100
-#define SUBSCRIPTION_MINIMAL 0x200
-#define SUBSCRIPTION_NODESCR 0x400 ///< no decramble
-#define SUBSCRIPTION_EMM 0x800 ///< add EMM PIDs for no descramble subscription
-#define SUBSCRIPTION_INITSCAN 0x1000 ///< for mux subscriptions
-#define SUBSCRIPTION_IDLESCAN 0x2000 ///< for mux subscriptions
-#define SUBSCRIPTION_USERSCAN 0x4000 ///< for mux subscriptions
-#define SUBSCRIPTION_EPG 0x8000 ///< for mux subscriptions
-#define SUBSCRIPTION_HTSP 0x10000
+#define SUBSCRIPTION_NONE 0x000
+#define SUBSCRIPTION_MPEGTS 0x001
+#define SUBSCRIPTION_PACKET 0x002
+#define SUBSCRIPTION_TYPE_MASK 0x00f
+#define SUBSCRIPTION_STREAMING 0x010
+#define SUBSCRIPTION_RESTART 0x020
+#define SUBSCRIPTION_CONTACCESS 0x040
+#define SUBSCRIPTION_ONESHOT 0x080
+#define SUBSCRIPTION_TABLES 0x100
+#define SUBSCRIPTION_MINIMAL 0x200
+#define SUBSCRIPTION_NODESCR 0x400 ///< no decramble
+#define SUBSCRIPTION_EMM 0x800 ///< add EMM PIDs for no descramble subscription
+#define SUBSCRIPTION_INITSCAN 0x1000 ///< for mux subscriptions
+#define SUBSCRIPTION_IDLESCAN 0x2000 ///< for mux subscriptions
+#define SUBSCRIPTION_USERSCAN 0x4000 ///< for mux subscriptions
+#define SUBSCRIPTION_EPG 0x8000 ///< for mux subscriptions
+#define SUBSCRIPTION_HTSP 0x10000
+#define SUBSCRIPTION_SWSERVICE 0x20000
/* Some internal priorities */
#define SUBSCRIPTION_PRIO_KEEP 1 ///< Keep input rolling
int ths_flags;
int ths_timeout;
+ int ths_ca_timeout;
int64_t ths_last_find;
int ths_last_error;