]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Stop crash if existing sub exists where all services are currently less than 10%...
authorAdam Sutton <dev@adamsutton.me.uk>
Tue, 2 Oct 2012 14:22:05 +0000 (15:22 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Tue, 2 Oct 2012 14:22:05 +0000 (15:22 +0100)
src/service.c

index b9c508abc5065acb776654fc144727d9f9c4231d..52936d66f17b0d1c8c7d8d00e83f3b003689854c 100644 (file)
@@ -364,6 +364,8 @@ service_find(channel_t *ch, unsigned int weight, const char *loginfo,
   /* First, try all services without stealing */
   for(i = off; i < cnt; i++) {
     t = vec[i];
+    if(t->s_status == SERVICE_RUNNING) 
+      return t;
     if(t->s_quality_index(t) < 10) {
       if(loginfo != NULL) {
          tvhlog(LOG_NOTICE, "Service",
@@ -375,9 +377,6 @@ service_find(channel_t *ch, unsigned int weight, const char *loginfo,
     }
     tvhlog(LOG_DEBUG, "Service", "%s: Probing adapter \"%s\" without stealing for service \"%s\"",
             loginfo, service_adapter_nicename(t), service_nicename(t));
-
-    if(t->s_status == SERVICE_RUNNING) 
-      return t;
     if((r = service_start(t, 0, 0)) == 0)
       return t;
     if(loginfo != NULL)