]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: use MPEGTS_FULLMUX_PID (8192) when the PID filter overflows, fixes #4442
authorJaroslav Kysela <perex@perex.cz>
Mon, 19 Jun 2017 07:29:19 +0000 (09:29 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 9 Feb 2018 10:13:34 +0000 (11:13 +0100)
src/input/mpegts/linuxdvb/linuxdvb_frontend.c
src/input/mpegts/linuxdvb/linuxdvb_private.h

index e733c4dadfc6e9bcab34804cb6822224a883439a..f9309c2653b5eba443765682da4be5a7590c8c4b 100644 (file)
@@ -131,6 +131,15 @@ const idclass_t linuxdvb_frontend_class =
       .opts     = PO_ADVANCED,
       .def.i    = 32
     },
+    {
+      .type     = PT_BOOL,
+      .id       = "pids_use_all",
+      .name     = N_("Allow all PIDs"),
+      .desc     = N_("Allow all PIDs (no filter) when the 'Maximum PIDs' limit is reached."),
+      .off      = offsetof(linuxdvb_frontend_t, lfe_pids_use_all),
+      .opts     = PO_ADVANCED,
+      .def.i    = 1
+    },
     {
       .type     = PT_BOOL,
       .id       = "powersave",
@@ -1276,10 +1285,11 @@ linuxdvb_update_pids ( linuxdvb_frontend_t *lfe, const char *name,
 {
   mpegts_apids_t wpid, padd, pdel;
   int i, max = MAX(14, lfe->lfe_pids_max);
+  int all = lfe->lfe_pids.all;
 
   pthread_mutex_lock(&lfe->lfe_dvr_lock);
 
-  if (!lfe->lfe_pids.all) {
+  if (!all) {
     mpegts_pid_weighted(&wpid, &lfe->lfe_pids, max);
     if (wpid.count > max && lfe->lfe_pids_use_all) {
       all = 1;
@@ -1298,9 +1308,9 @@ linuxdvb_update_pids ( linuxdvb_frontend_t *lfe, const char *name,
     }
   }
 
-  if (lfe->lfe_pids.all && !linuxdvb_pid_exists(pids, pids_size, MPEGTS_FULLMUX_PID))
+  if (all && !linuxdvb_pid_exists(pids, pids_size, MPEGTS_FULLMUX_PID))
     linuxdvb_frontend_open_pid0(lfe, name, pids, pids_size, MPEGTS_FULLMUX_PID);
-  else if (!lfe->lfe_pids.all && linuxdvb_pid_exists(pids, pids_size, MPEGTS_FULLMUX_PID))
+  else if (!all && linuxdvb_pid_exists(pids, pids_size, MPEGTS_FULLMUX_PID))
     linuxdvb_frontend_close_pid0(lfe, name, pids, pids_size, MPEGTS_FULLMUX_PID);
 
   tuned->all = lfe->lfe_pids.all;
@@ -2090,6 +2100,7 @@ linuxdvb_frontend_create
   lfe->lfe_ibuf_size = 188000;
   lfe->lfe_status_period = 1000;
   lfe->lfe_pids_max = 32;
+  lfe->lfe_pids_use_all = 1;
   lfe = (linuxdvb_frontend_t*)mpegts_input_create0((mpegts_input_t*)lfe, idc, uuid, conf);
   if (!lfe) return NULL;
 
index daeb1e258c8cfc088a7c00801b4008a7fd0797e0..41b9845b87a44454b750d7b19e7b8d224b552c53 100644 (file)
@@ -128,6 +128,7 @@ struct linuxdvb_frontend
   tvh_cond_t                lfe_dvr_cond;
   mpegts_apids_t            lfe_pids;
   int                       lfe_pids_max;
+  int                       lfe_pids_use_all;
  
   /*
    * Tuning