From: Jaroslav Kysela Date: Wed, 29 Apr 2015 14:08:22 +0000 (+0200) Subject: profile: add 'continue on access error', fix 'force priority' X-Git-Tag: v4.1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09265f0205cdaf04f927b935813ca296c4662928;p=thirdparty%2Ftvheadend.git profile: add 'continue on access error', fix 'force priority' --- diff --git a/src/profile.c b/src/profile.c index 870bff224..289fae2f2 100644 --- a/src/profile.c +++ b/src/profile.c @@ -98,6 +98,7 @@ profile_create } LIST_INIT(&pro->pro_dvr_configs); LIST_INIT(&pro->pro_accesses); + pro->pro_contaccess = 1; if (idnode_insert(&pro->pro_id, uuid, pb->clazz, 0)) { if (uuid) tvherror("profile", "invalid uuid '%s'", uuid); @@ -313,7 +314,7 @@ const idclass_t profile_class = .def.i = PROFILE_SPRIO_NORMAL }, { - .type = PT_BOOL, + .type = PT_INT, .id = "fpriority", .name = "Force Priority", .off = offsetof(profile_t, pro_fprio), @@ -332,6 +333,13 @@ const idclass_t profile_class = .off = offsetof(profile_t, pro_restart), .def.i = 0, }, + { + .type = PT_BOOL, + .id = "contaccess", + .name = "Continue On Access Error", + .off = offsetof(profile_t, pro_contaccess), + .def.i = 1, + }, { } } }; diff --git a/src/profile.h b/src/profile.h index b0d4270a3..d2169be4e 100644 --- a/src/profile.h +++ b/src/profile.h @@ -122,6 +122,7 @@ typedef struct profile { int pro_fprio; int pro_timeout; int pro_restart; + int pro_contaccess; void (*pro_free)(struct profile *pro); void (*pro_conf_changed)(struct profile *pro); diff --git a/src/subscriptions.c b/src/subscriptions.c index 00252f0bd..b44aff9b8 100644 --- a/src/subscriptions.c +++ b/src/subscriptions.c @@ -494,10 +494,13 @@ subscription_input(void *opauqe, streaming_message_t *sm) // No, mark our subscription as bad_service // the scheduler will take care of things error = tss2errcode(sm->sm_code); - if (error > s->ths_testing_error) - s->ths_testing_error = error; - s->ths_state = SUBSCRIPTION_BAD_SERVICE; - streaming_msg_free(sm); + if (error != SM_CODE_NO_ACCESS || + (s->ths_flags & SUBSCRIPTION_CONTACCESS) == 0) { + if (error > s->ths_testing_error) + s->ths_testing_error = error; + s->ths_state = SUBSCRIPTION_BAD_SERVICE; + streaming_msg_free(sm); + } return; } @@ -521,9 +524,12 @@ subscription_input(void *opauqe, streaming_message_t *sm) if (sm->sm_type == SMT_SERVICE_STATUS && sm->sm_code & (TSS_TUNING|TSS_TIMEOUT)) { error = tss2errcode(sm->sm_code); - if (error > s->ths_testing_error) - s->ths_testing_error = error; - s->ths_state = SUBSCRIPTION_BAD_SERVICE; + if (error != SM_CODE_NO_ACCESS || + (s->ths_flags & SUBSCRIPTION_CONTACCESS) == 0) { + if (error > s->ths_testing_error) + s->ths_testing_error = error; + s->ths_state = SUBSCRIPTION_BAD_SERVICE; + } } /* Pass to direct handler to log traffic */ @@ -660,8 +666,12 @@ subscription_create else s->ths_weight = weight; - if (pro && pro->pro_restart) - s->ths_flags |= SUBSCRIPTION_RESTART; + if (pro) { + if (pro->pro_restart) + s->ths_flags |= SUBSCRIPTION_RESTART; + if (pro->pro_contaccess) + s->ths_flags |= SUBSCRIPTION_CONTACCESS; + } time(&s->ths_start); diff --git a/src/subscriptions.h b/src/subscriptions.h index c2ad74dca..a866372c5 100644 --- a/src/subscriptions.h +++ b/src/subscriptions.h @@ -31,13 +31,14 @@ extern struct th_subscription_list subscriptions; #define SUBSCRIPTION_TYPE_MASK 0x00f #define SUBSCRIPTION_STREAMING 0x010 #define SUBSCRIPTION_RESTART 0x020 -#define SUBSCRIPTION_ONESHOT 0x040 -#define SUBSCRIPTION_TABLES 0x080 -#define SUBSCRIPTION_INITSCAN 0x100 ///< for mux subscriptions -#define SUBSCRIPTION_IDLESCAN 0x200 ///< for mux subscriptions -#define SUBSCRIPTION_USERSCAN 0x400 ///< for mux subscriptions -#define SUBSCRIPTION_EPG 0x800 ///< for mux subscriptions -#define SUBSCRIPTION_MINIMAL 0x1000 +#define SUBSCRIPTION_CONTACCESS 0x040 +#define SUBSCRIPTION_ONESHOT 0x090 +#define SUBSCRIPTION_TABLES 0x100 +#define SUBSCRIPTION_MINIMAL 0x200 +#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 /* Some internal priorities */ #define SUBSCRIPTION_PRIO_KEEP 1 ///< Keep input rolling