pthread_mutex_lock(&t->s_stream_mutex);
- had_components = TAILQ_FIRST(&t->s_filt_components) != NULL;
+ had_components = TAILQ_FIRST(&t->s_filt_components) != NULL &&
+ t->s_running;
service_build_filter(t);
streaming_pad_deliver(&t->s_streaming_pad,
streaming_msg_create_data(SMT_START,
service_build_stream_start(t)));
+ t->s_running = 1;
} else {
streaming_pad_deliver(&t->s_streaming_pad,
streaming_msg_create_code(SMT_STOP,
SM_CODE_NO_SERVICE));
+ t->s_running = 0;
}
pthread_mutex_unlock(&t->s_stream_mutex);
// Send a START message to the subscription client
streaming_target_deliver(s->ths_output, s->ths_start_message);
s->ths_start_message = NULL;
+ t->s_running = 1;
// Send status report
sm = streaming_msg_create_code(SMT_SERVICE_STATUS,
// Send a STOP message to the subscription client
sm = streaming_msg_create_code(SMT_STOP, reason);
streaming_target_deliver(s->ths_output, sm);
+ t->s_running = 0;
}
pthread_mutex_unlock(&t->s_stream_mutex);
if(s->ths_start_message != NULL) {
streaming_target_deliver(s->ths_output, s->ths_start_message);
s->ths_start_message = NULL;
+ if (s->ths_service)
+ s->ths_service->s_running = 1;
}
s->ths_state = SUBSCRIPTION_GOT_SERVICE;
}