Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
service: handle tuner/service priority settings also for free input i…
…nstances, fixes #3948
  • Loading branch information
perexg committed Aug 21, 2016
1 parent 3de3244 commit c53ee12
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/service.c
Expand Up @@ -815,15 +815,17 @@ service_find_instance

/* Already running? */
TAILQ_FOREACH(si, sil, si_link)
if(si->si_s->s_status == SERVICE_RUNNING && si->si_error == 0) {
if (si->si_s->s_status == SERVICE_RUNNING && si->si_error == 0) {
tvhtrace(LS_SERVICE, "return already running %p", si);
return si;
}

/* Forced */
TAILQ_FOREACH(si, sil, si_link)
if(si->si_weight < 0 && si->si_error == 0)
break;
/* Forced, handle priority settings */
si = NULL;
TAILQ_FOREACH(next, sil, si_link)
if (next->si_weight < 0 && next->si_error == 0)
if (si == NULL || next->si_prio > si->si_prio)
si = next;

/* Idle */
if (!si) {
Expand Down

0 comments on commit c53ee12

Please sign in to comment.