profile/service: sharer - fix the stop/reconfiguration

This commit is contained in:
Jaroslav Kysela 2014-11-02 16:16:01 +01:00
parent 409b0140c6
commit 723a7ed168
3 changed files with 8 additions and 2 deletions

View file

@ -483,4 +483,3 @@ tsfix_destroy(streaming_target_t *pad)
tsfix_destroy_streams(tf);
free(tf);
}

View file

@ -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) {

View file

@ -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);