From: Jaroslav Kysela Date: Sun, 2 Nov 2014 15:16:01 +0000 (+0100) Subject: profile/service: sharer - fix the stop/reconfiguration X-Git-Tag: v4.1~862 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=723a7ed16865e52aecc05a9b37164b8f2dac4771;p=thirdparty%2Ftvheadend.git profile/service: sharer - fix the stop/reconfiguration --- diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 7a2572927..5dfb7ab1c 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -483,4 +483,3 @@ tsfix_destroy(streaming_target_t *pad) tsfix_destroy_streams(tf); free(tf); } - diff --git a/src/profile.c b/src/profile.c index 3d75ac444..f6df0a66d 100644 --- a/src/profile.c +++ b/src/profile.c @@ -466,8 +466,11 @@ profile_input(void *opaque, streaming_message_t *sm) profile_chain_t *prch = opaque, *prch2; profile_sharer_t *prsh = prch->prch_sharer; - if (sm->sm_type == SMT_START) + if (sm->sm_type == SMT_START) { + if (!prsh->prsh_master) + prsh->prsh_master = prch; prch->prch_stop = 0; + } if (prch == prsh->prsh_master) { if (sm->sm_type == SMT_STOP) { diff --git a/src/service.c b/src/service.c index a3fbe8f69..1edabe82b 100644 --- a/src/service.c +++ b/src/service.c @@ -1166,6 +1166,10 @@ service_restart(service_t *t, int had_components) streaming_pad_deliver(&t->s_streaming_pad, streaming_msg_create_data(SMT_START, service_build_stream_start(t))); + } else { + streaming_pad_deliver(&t->s_streaming_pad, + streaming_msg_create_code(SMT_STOP, + SM_CODE_NO_SERVICE)); } pthread_mutex_unlock(&t->s_stream_mutex);