]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
subscription: fix the oneshot override subscription cleanup
authorJaroslav Kysela <perex@perex.cz>
Sun, 31 May 2015 09:27:59 +0000 (11:27 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 31 May 2015 09:38:33 +0000 (11:38 +0200)
src/subscriptions.c

index fb8bbc5deac31122986aadaac9c1d5d9bb9aabe6..95d7b9808ac83fa6cab99e5e0f02816514832ef0 100644 (file)
@@ -142,6 +142,9 @@ subscription_unlink_service0(th_subscription_t *s, int reason, int stop)
 
   LIST_REMOVE(s, ths_service_link);
   s->ths_service = NULL;
+
+  if (stop && (s->ths_flags & SUBSCRIPTION_ONESHOT) != 0)
+    subscription_unsubscribe(s, 0);
 }
 
 void
@@ -584,6 +587,7 @@ subscription_unsubscribe(th_subscription_t *s, int quiet)
   tvhlog(quiet ? LOG_TRACE : LOG_INFO, "subscription", "%04X: %s", shortid(s), buf);
 
   if (t) {
+    s->ths_flags &= ~SUBSCRIPTION_ONESHOT;
     service_remove_subscriber(t, s, SM_CODE_OK);
   }