From: Jaroslav Kysela Date: Sun, 18 Jan 2015 20:35:00 +0000 (+0100) Subject: service: add per-service priority modificator, fixes #2249 X-Git-Tag: v4.1~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba7d8fa23a92141cc259c9d6a6a02e5b70ac02d9;p=thirdparty%2Ftvheadend.git service: add per-service priority modificator, fixes #2249 --- diff --git a/docs/html/config_services.html b/docs/html/config_services.html index 6814f7577..cf1b415a5 100644 --- a/docs/html/config_services.html +++ b/docs/html/config_services.html @@ -24,6 +24,11 @@ check can be also disabled for given service using this column. +
Priority +
Define priority (range 0-10) for this service. The higher value means more preferred. + Note that this value is _added_ to the input (tuner) priority. + Take this in account when you set the input priorities. +
Channel
The channel to which the service is mapped diff --git a/src/service.c b/src/service.c index 06107772e..25822580f 100644 --- a/src/service.c +++ b/src/service.c @@ -222,6 +222,12 @@ const idclass_t service_class = { .rend = service_class_channel_rend, .opts = PO_NOSAVE }, + { + .type = PT_INT, + .id = "priority", + .name = "Priority (0-10)", + .off = offsetof(service_t, s_prio), + }, { .type = PT_BOOL, .id = "encrypted", @@ -1536,6 +1542,8 @@ service_instance_add(service_instance_list_t *sil, { service_instance_t *si; + prio += MAX(0, MIN(10, s->s_prio)); + /* Existing */ TAILQ_FOREACH(si, sil, si_link) if(si->si_s == s && si->si_instance == instance) diff --git a/src/service.h b/src/service.h index fb8b38f2e..9368b9e94 100644 --- a/src/service.h +++ b/src/service.h @@ -288,6 +288,7 @@ typedef struct service { */ int s_enabled; int s_auto; + int s_prio; LIST_ENTRY(service) s_active_link;