]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
pass muxer: add possibitity to continue streaming even if the service is changing...
authorJaroslav Kysela <perex@perex.cz>
Sat, 24 Nov 2018 18:05:29 +0000 (19:05 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 24 Nov 2018 18:06:38 +0000 (19:06 +0100)
src/channels.c
src/channels.h
src/muxer.h
src/muxer/muxer_pass.c
src/webui/webui.c

index 996d81250da8d618bee0f2d0d5f0a542287c0995..57822ec02885d87554399de0ca7d25848c3b4cd2 100644 (file)
@@ -2002,3 +2002,19 @@ channel_has_correct_service_filter(const channel_t *ch, int svf)
   }
   return 0;
 }
+
+int channel_multi_services_active(const channel_t *ch)
+{
+  const idnode_list_mapping_t *ilm;
+  const service_t *service;
+  int cnt = 0;
+  if (!ch) return 0;
+  LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+    service = (const service_t*)ilm->ilm_in1;
+    if (service->s_enabled) {
+      if (++cnt > 1)
+        return 1;
+    }
+  }
+  return 0;
+}
index 5d4bd79fb5e10dd9c4380935321be0d7927f4f22..97e8579d4a79960b63232aa2438943c369b3b8aa 100644 (file)
@@ -221,5 +221,6 @@ channel_t **channel_get_sorted_list_for_tag
 channel_tag_t **channel_tag_get_sorted_list
   ( const char *sort_type, int *_count );
 int channel_has_correct_service_filter(const channel_t *ch, int svf);
+int channel_multi_services_active(const channel_t *ch);
 
 #endif /* CHANNELS_H */
index 9801f9b78f6b7e902e92402d6d6a8f8fe2e1e9cd..d20af8bdd383238d39034172816cdcc6dfe136b7 100644 (file)
@@ -24,6 +24,8 @@
 
 #define MC_IS_EOS_ERROR(e) ((e) == EPIPE || (e) == ECONNRESET)
 
+#define MC_CAP_ANOTHER_SERVICE (1<<0)  /* I can stream another service (SID must match!) */
+
 typedef enum {
   MC_UNKNOWN     = 0,
   MC_MATROSKA    = 1,
@@ -120,6 +122,7 @@ typedef struct muxer {
 
   int                    m_eos;        /* End of stream */
   int                    m_errors;     /* Number of errors */
+  int                    m_caps;       /* Capabilities */
   muxer_config_t         m_config;     /* general configuration */
   muxer_hints_t         *m_hints;      /* other hints */
 } muxer_t;
index 32f1277875bb1d26a010ec259e7e24df5454d844..89e673c2b3897c6070b6eb14885dc2d4d793b5f7 100644 (file)
@@ -800,5 +800,8 @@ pass_muxer_create(const muxer_config_t *m_cfg,
   dvb_table_parse_init(&pm->pm_eit, "pass-eit", LS_TBL_PASS, DVB_EIT_PID,
                        0, 0, pm);
 
+  if (pm->m_config.u.pass.m_rewrite_sid > 0)
+    pm->m_caps |= MC_CAP_ANOTHER_SERVICE;
+
   return (muxer_t *)pm;
 }
index f8769f99d4a34215ac02bbea57fce370699bc618..63eb0d17a78eaad70e7d06e288831575a9070d4b 100644 (file)
@@ -450,6 +450,9 @@ http_stream_run(http_connection_t *hc, profile_chain_t *prch,
       break;
 
     case SMT_STOP:
+      if((mux->m_caps & MC_CAP_ANOTHER_SERVICE) != 0 &&
+         channel_multi_services_active(s->ths_channel))
+        break;
       if(sm->sm_code != SM_CODE_SOURCE_RECONFIGURED) {
         tvhwarn(LS_WEBUI,  "Stop streaming %s, %s", hc->hc_url_orig, 
                 streaming_code2txt(sm->sm_code));