]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
service: fix the 'service switch' streaming option
authorJaroslav Kysela <perex@perex.cz>
Thu, 6 Apr 2017 15:53:40 +0000 (17:53 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 6 Apr 2017 15:53:40 +0000 (17:53 +0200)
src/service.c

index d875b334d71588ec26735f8bc7f85aa262255753..37754c2f1287360194b350dc86ae714b1183567f 100644 (file)
@@ -747,10 +747,9 @@ service_find_instance
   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 && si->si_error)
-          next->si_error = si->si_error;
+      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);
     }
   }