]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
profile: another fix for profile_find_by_list
authorJaroslav Kysela <perex@perex.cz>
Sun, 14 Jun 2015 10:11:21 +0000 (12:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 29 Sep 2015 06:26:04 +0000 (08:26 +0200)
src/profile.c

index 4146c34d2493e49e3a95381c9f86cb2c9a6a66b6..e93d1196ac61abb2444f4a9656dc368f4a003647 100644 (file)
@@ -408,6 +408,8 @@ profile_verify(profile_t *pro, int sflags)
     return 0;
   if ((sflags & SUBSCRIPTION_HTSP) != 0 && !pro->pro_work)
     return 0;
+  if ((sflags & SUBSCRIPTION_HTSP) == 0 && !pro->pro_open)
+    return 0;
   sflags &= pro->pro_sflags;
   sflags &= SUBSCRIPTION_PACKET|SUBSCRIPTION_MPEGTS;
   return sflags ? 1 : 0;
@@ -427,6 +429,7 @@ profile_find_by_list
   pro = profile_find_by_uuid(name);
   if (!pro)
     pro = profile_find_by_name(name, alt);
+  if (!profile_verify(pro, sflags))
     pro = NULL;
   if (uuids) {
     uuid = pro ? idnode_uuid_as_str(&pro->pro_id) : "";
@@ -444,7 +447,7 @@ profile_find_by_list
     res = pro;
   }
   if (!res)
-    res = profile_find_by_name(!strcmp(alt, "htsp") ? "htsp" : NULL, NULL);
+    res = profile_find_by_name((sflags & SUBSCRIPTION_HTSP) ? "htsp" : NULL, NULL);
   return res;
 }