]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
service: add per-service priority modificator, fixes #2249
authorJaroslav Kysela <perex@perex.cz>
Sun, 18 Jan 2015 20:35:00 +0000 (21:35 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 18 Jan 2015 20:35:00 +0000 (21:35 +0100)
docs/html/config_services.html
src/service.c
src/service.h

index 6814f75772e6a4cedf0a8f1cffe87b35abf83c5a..cf1b415a5cf0ee32162b341dd56bd515f9ffb605 100644 (file)
                     check can be also disabled for given service using this
                     column.
 
+               <dt>Priority
+               <dd>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.
+
                <dt>Channel
                <dd>The channel to which the service is mapped
 
index 06107772ee0ccd1ebee394d87269cd3bdf6c7a8d..25822580fcc242bd20ae6d8dc9a9359a2de45108 100644 (file)
@@ -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)
index fb8b38f2e3fdfce5a6a302ae3a5ba26d2e6fa503..9368b9e9443bc7ae8db74a8be3eef72da3e5436d 100644 (file)
@@ -288,6 +288,7 @@ typedef struct service {
    */
   int s_enabled;
   int s_auto;
+  int s_prio;
 
   LIST_ENTRY(service) s_active_link;