]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: allow to modify the input buffer size
authorJaroslav Kysela <perex@perex.cz>
Sat, 17 Jan 2015 18:02:38 +0000 (19:02 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 17 Jan 2015 18:20:43 +0000 (19:20 +0100)
docs/html/config_tvadapters.html
src/input/mpegts/linuxdvb/linuxdvb_frontend.c
src/input/mpegts/linuxdvb/linuxdvb_private.h

index 12802af4e173a45a78cb4a1b9a98d6884a5d56ce..27a9c2732067498eb3428ae367b585b6c8ebe883 100644 (file)
@@ -72,6 +72,10 @@ The rows have the following functions
   <dd>If set, first bytes from the MPEG-TS stream are discarded. It may be
       required for some drivers / hardware which does not flush completely
       the MPEG-TS buffers after a frequency/parameters change.</dd>
+<p>
+ <dt><b>Input Buffer (Bytes)</b></dt>
+  <dd>By default, linuxdvb input buffer is 18800 bytes long. The accepted
+      range is 18800-1880000 bytes.</dd>
 </dl>
 
 <p>
index eca30ce6d20e7135b6328dc8ff03112f87975bb2..620dcec30f4abf04bc0c99561da0a7fb10bc5212 100644 (file)
@@ -106,6 +106,13 @@ const idclass_t linuxdvb_frontend_class =
       .opts     = PO_ADVANCED,
       .off      = offsetof(linuxdvb_frontend_t, lfe_skip_bytes),
     },
+    {
+      .type     = PT_U32,
+      .id       = "ibuf_size",
+      .name     = "Input Buffer (Bytes)",
+      .opts     = PO_ADVANCED,
+      .off      = offsetof(linuxdvb_frontend_t, lfe_ibuf_size),
+    },
     {}
   }
 };
@@ -886,7 +893,7 @@ linuxdvb_frontend_input_thread ( void *aux )
   tvhpoll_add(efd, ev, 2);
 
   /* Allocate memory */
-  sbuf_init_fixed(&sb, 18800);
+  sbuf_init_fixed(&sb, MIN(MAX(18800, lfe->lfe_ibuf_size), 1880000));
 
   /* Read */
   while (tvheadend_running) {
@@ -1433,6 +1440,7 @@ linuxdvb_frontend_create
   lfe->lfe_type = type;
   strncpy(lfe->lfe_name, name, sizeof(lfe->lfe_name));
   lfe->lfe_name[sizeof(lfe->lfe_name)-1] = '\0';
+  lfe->lfe_ibuf_size = 18800;
   lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
   if (!lfe) return NULL;
 
index 7d8156ae805eb1d496c31969ec9eb1e01acfced0..f03557c8b086dd1285a86b3462ca5171ffd1c606 100644 (file)
@@ -116,6 +116,7 @@ struct linuxdvb_frontend
   int                       lfe_powersave;
   int                       lfe_tune_repeats;
   uint32_t                  lfe_skip_bytes;
+  uint32_t                  lfe_ibuf_size;
 
   /*
    * Satconf (DVB-S only)