]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
IPTV: add configurable stream timeout
authorJaroslav Kysela <perex@perex.cz>
Wed, 14 May 2014 21:10:59 +0000 (23:10 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 14 May 2014 21:11:49 +0000 (23:11 +0200)
src/input/mpegts/iptv/iptv.c
src/input/mpegts/iptv/iptv_private.h

index 1195c3f7a5b44dffac3da03ddfe1d3372be24baf..1d2b44b399d7a42ace70c46e255b9acfc5b8b49c 100644 (file)
@@ -161,6 +161,14 @@ iptv_input_get_weight ( mpegts_input_t *mi )
 
 }
 
+static int
+iptv_input_get_grace ( mpegts_input_t *mi, mpegts_mux_t *mm )
+{
+  iptv_mux_t *im = (iptv_mux_t *)mm;
+  iptv_network_t *in = (iptv_network_t *)im->mm_network;
+  return in->in_max_timeout;
+}
+
 static int
 iptv_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
 {
@@ -406,6 +414,13 @@ const idclass_t iptv_network_class = {
       .off      = offsetof(iptv_network_t, in_max_bandwidth),
       .def.i    = 0,
     },
+    {
+      .type     = PT_U32,
+      .id       = "max_timeout",
+      .name     = "Max timeout (seconds)",
+      .off      = offsetof(iptv_network_t, in_max_timeout),
+      .def.i    = 15,
+    },
     {}
   }
 };
@@ -529,6 +544,7 @@ void iptv_init ( void )
   iptv_input->mi_stop_mux       = iptv_input_stop_mux;
   iptv_input->mi_is_free        = iptv_input_is_free;
   iptv_input->mi_get_weight     = iptv_input_get_weight;
+  iptv_input->mi_get_grace      = iptv_input_get_grace;
   iptv_input->mi_display_name   = iptv_input_display_name;
   iptv_input->mi_enabled        = 1;
 
index 966a27461c2254a70800b44d724b0790a0b99dd2..c46fad863047ad4b5c1f4f369c2fd39f26570b3f 100644 (file)
@@ -64,6 +64,7 @@ struct iptv_network
 
   uint32_t in_max_streams;
   uint32_t in_max_bandwidth;
+  uint32_t in_max_timeout;
 };
 
 iptv_network_t *iptv_network_create0 ( const char *uuid, htsmsg_t *conf );