From 723a7ed16865e52aecc05a9b37164b8f2dac4771 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 2 Nov 2014 16:16:01 +0100 Subject: [PATCH] profile/service: sharer - fix the stop/reconfiguration --- src/plumbing/tsfix.c | 1 - src/profile.c | 5 ++++- src/service.c | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 7a257292..5dfb7ab1 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 3d75ac44..f6df0a66 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 a3fbe8f6..1edabe82 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);