subscriptions: add missing service_stop() call for the BAD_SERVICE state
This commit is contained in:
parent
33ec853dbd
commit
e0028b308a
3 changed files with 11 additions and 5 deletions
|
@ -262,7 +262,7 @@ service_stream_destroy(service_t *t, elementary_stream_t *es)
|
|||
/**
|
||||
* Service lock must be held
|
||||
*/
|
||||
static void
|
||||
void
|
||||
service_stop(service_t *t)
|
||||
{
|
||||
elementary_stream_t *st;
|
||||
|
|
|
@ -439,6 +439,7 @@ void service_init(void);
|
|||
void service_done(void);
|
||||
|
||||
int service_start(service_t *t, int instance);
|
||||
void service_stop(service_t *t);
|
||||
|
||||
void service_build_filter(service_t *t);
|
||||
|
||||
|
|
|
@ -200,6 +200,7 @@ subscription_reschedule(void)
|
|||
{
|
||||
static int reenter = 0;
|
||||
th_subscription_t *s;
|
||||
service_t *t;
|
||||
service_instance_t *si;
|
||||
streaming_message_t *sm;
|
||||
int error;
|
||||
|
@ -215,17 +216,21 @@ subscription_reschedule(void)
|
|||
if (s->ths_mmi) continue;
|
||||
if (!s->ths_service && !s->ths_channel) continue;
|
||||
|
||||
if(s->ths_service != NULL && s->ths_current_instance != NULL) {
|
||||
t = s->ths_service;
|
||||
if(t != NULL && s->ths_current_instance != NULL) {
|
||||
/* Already got a service */
|
||||
|
||||
if(s->ths_state != SUBSCRIPTION_BAD_SERVICE)
|
||||
continue; /* And it not bad, so we're happy */
|
||||
|
||||
s->ths_service->s_streaming_status = 0;
|
||||
s->ths_service->s_status = SERVICE_IDLE;
|
||||
t->s_streaming_status = 0;
|
||||
t->s_status = SERVICE_IDLE;
|
||||
|
||||
subscription_unlink_service0(s, SM_CODE_BAD_SOURCE, 0);
|
||||
|
||||
if(t && LIST_FIRST(&t->s_subscriptions) == NULL)
|
||||
service_stop(t);
|
||||
|
||||
si = s->ths_current_instance;
|
||||
|
||||
assert(si != NULL);
|
||||
|
@ -240,7 +245,7 @@ subscription_reschedule(void)
|
|||
if (s->ths_channel)
|
||||
tvhtrace("subscription", "find service for %s weight %d",
|
||||
channel_get_name(s->ths_channel), s->ths_weight);
|
||||
else
|
||||
else
|
||||
tvhtrace("subscription", "find instance for %s weight %d",
|
||||
s->ths_service->s_nicename, s->ths_weight);
|
||||
si = service_find_instance(s->ths_service, s->ths_channel,
|
||||
|
|
Loading…
Add table
Reference in a new issue