From: Adam Sutton Date: Tue, 2 Oct 2012 14:22:05 +0000 (+0100) Subject: Stop crash if existing sub exists where all services are currently less than 10%... X-Git-Tag: v3.5~410 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4310485eb0b5fa83d8d37240db53fa0ee115ab63;p=thirdparty%2Ftvheadend.git Stop crash if existing sub exists where all services are currently less than 10%. Fixes #1289 --- diff --git a/src/service.c b/src/service.c index b9c508abc..52936d66f 100644 --- a/src/service.c +++ b/src/service.c @@ -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)