]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
subscription: improve 'Switch to another service' behaviour, fixes #4922
authorJaroslav Kysela <perex@perex.cz>
Wed, 21 Mar 2018 12:07:05 +0000 (13:07 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 21 Mar 2018 12:07:05 +0000 (13:07 +0100)
If the channel has only one service, switch to standard behaviour
where all service instances (inputs) are tried before the subcription
fails.

src/service.c

index 48e478e5229b011119cc19423a325223a69d062a..f5b2f63eeb8fbeff86601f7818cbf954eadd3d8c 100644 (file)
@@ -767,9 +767,19 @@ service_find_instance
   lock_assert(&global_lock);
 
   /* Build list */
+  r = 0;
+  if (flags & SUBSCRIPTION_SWSERVICE) {
+    TAILQ_FOREACH(si, sil, si_link) {
+      next = TAILQ_NEXT(si, si_link);
+      if (next && next->si_s != si->si_s) {
+        r++;
+        break;
+      }
+    }
+  }
   TAILQ_FOREACH(si, sil, si_link) {
     si->si_mark = 1;
-    if (flags & SUBSCRIPTION_SWSERVICE) {
+    if (r && (flags & SUBSCRIPTION_SWSERVICE) != 0) {
       TAILQ_FOREACH(next, sil, si_link)
         if (next != si && si->si_s == next->si_s && si->si_error)
           next->si_error = MAX(next->si_error, si->si_error);