]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
profile/service: sharer - fix the stop/reconfiguration
authorJaroslav Kysela <perex@perex.cz>
Sun, 2 Nov 2014 15:16:01 +0000 (16:16 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 2 Nov 2014 15:16:01 +0000 (16:16 +0100)
src/plumbing/tsfix.c
src/profile.c
src/service.c

index 7a2572927af3d1f68f68e5948e0a16189c58e471..5dfb7ab1cc9c6f5c8d079d3427a7a39306d95696 100644 (file)
@@ -483,4 +483,3 @@ tsfix_destroy(streaming_target_t *pad)
   tsfix_destroy_streams(tf);
   free(tf);
 }
-
index 3d75ac444e97decb0d31303f32b99a012588145e..f6df0a66d063db5953d99ec25a7db2cbe3b94deb 100644 (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) {
index a3fbe8f690af6e7758d6f801278477547096e4ac..1edabe82b31c0ddad9bfd1615c4d6a3a633d9504 100644 (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);