]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvbcam: fix allocated_programs handling
authorJaroslav Kysela <perex@perex.cz>
Tue, 21 Nov 2017 19:03:53 +0000 (20:03 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 21 Nov 2017 19:03:53 +0000 (20:03 +0100)
src/descrambler/dvbcam.c

index 73b6135a3450be8042d6b9c9e1988cd1a661116b..b190804cb2e023490fe4db5db5d905e44407990a 100644 (file)
@@ -312,13 +312,12 @@ dvbcam_service_destroy(th_descrambler_t *td)
   LIST_REMOVE(as, dvbcam_link);
   LIST_REMOVE(td, td_service_link);
   TAILQ_REMOVE(&dvbcam_active_services, as, global_link);
-  if (do_active_programs) {
-    TAILQ_FOREACH(ac, &dvbcam_active_cams, global_link) {
-      if (as->ac == ac) {
+  TAILQ_FOREACH(ac, &dvbcam_active_cams, global_link) {
+    if (as->ac == ac) {
+      if (do_active_programs)
         ac->active_programs--;
-        ac->allocated_programs--;
-        break;
-      }
+      ac->allocated_programs--;
+      break;
     }
   }
   mpegts_pid_done(&as->ecm_pids);