]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
eit: another attempt to fix the freesat issue (slave eit), fixes #5247
authorJaroslav Kysela <perex@perex.cz>
Tue, 1 Jan 2019 18:42:02 +0000 (19:42 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 1 Jan 2019 18:42:02 +0000 (19:42 +0100)
data/conf/epggrab/eit/config
src/epggrab.h
src/epggrab/module/eit.c

index e8226ebafe678fef136ff6bfcb8364829a2db102..54a9eda2e988319e1567962f2c320ec9a6735c79 100644 (file)
     },
     "priv": 1179861332,
     "hacks": {
-       "eit": 1,
+       "slave": "uk_freesat_eit",
        "bat": { "pid": 3002 },
        "interest-4e": 1
     }
   },
 
+  "uk_freesat_eit": {
+    "name": {
+      "eng": "UK: Freesat"
+    },
+    "prio": 6,
+    "conv": "huffman",
+    "nit": {
+      "Freesat": 1
+    },
+    "priv": 1179861332,
+    "hacks": {
+       "interest-4e": 1
+    }
+  },
+
   "uk_freeview": {
     "name": {
       "eng": "UK: Freeview"
index 4bcdc7878ff380bcadebce7c5d208c1b1efff1d8..728b4bab2108f0f9e83f6bf9c786d7a730185437 100644 (file)
@@ -275,7 +275,7 @@ struct epggrab_ota_map
   uint8_t                             om_first;
   uint8_t                             om_forced;
   uint64_t                            om_tune_count;
-  RB_HEAD(,epggrab_ota_svc_link)      om_svcs;         ///< Muxes we carry data for
+  RB_HEAD(,epggrab_ota_svc_link)      om_svcs;         ///< Services we carry data for
   void                               *om_opaque;
 };
 
index 7dcfe085ecfd366946e0e9874e4f68ef8dc94da8..d28196fb12f83c8e57c1c1d250b6f8aee8def6ae 100644 (file)
@@ -62,6 +62,7 @@ typedef struct eit_private
   uint32_t sdt_enable;
   uint32_t hacks;
   uint32_t priv;
+  char slave[32];
   LIST_HEAD(, eit_nit) nit;
   LIST_HEAD(, eit_sdt) sdt;
   epggrab_ota_module_ops_t *ops;
@@ -69,10 +70,9 @@ typedef struct eit_private
 
 #define EIT_CONV_HUFFMAN            1
 
-#define EIT_HACK_EIT                (1<<0)
-#define EIT_HACK_INTEREST4E         (1<<1)
-#define EIT_HACK_EXTRAMUXLOOKUP     (1<<2)
-#define EIT_HACK_SVCNETLOOKUP       (1<<3)
+#define EIT_HACK_INTEREST4E         (1<<0)
+#define EIT_HACK_EXTRAMUXLOOKUP     (1<<1)
+#define EIT_HACK_SVCNETLOOKUP       (1<<2)
 
 /* Queued data structure */
 typedef struct eit_data
@@ -1110,6 +1110,25 @@ static int _eit_start
   return 0;
 }
 
+static void _eit_install_one_handler
+  ( mpegts_mux_t *dm, epggrab_ota_map_t *map )
+{
+  epggrab_module_ota_t *m = map->om_module;
+  eit_private_t *priv = m->opaque;
+  int pid = priv->pid;
+  int opts = 0;
+
+  /* Standard (0x12) */
+  if (pid == 0) {
+    pid  = DVB_EIT_PID;
+    opts = MT_RECORD;
+  }
+
+  mpegts_table_add(dm, 0, 0, _eit_callback, map, map->om_module->id, LS_TBL_EIT,
+                   MT_CRC | opts, pid, MPS_WEIGHT_EIT);
+  tvhdebug(m->subsys, "%s: installed table handler (pid %d)", m->id, pid);
+}
+
 static void _eit_install_handlers
   ( epggrab_ota_map_t *_map, mpegts_mux_t *dm )
 {
@@ -1118,7 +1137,6 @@ static void _eit_install_handlers
   epggrab_module_ota_t *m, *m2;
   epggrab_ota_mux_eit_plist_t *plist;
   eit_private_t *priv, *priv2;
-  int pid, opts;
 
   om = epggrab_ota_find_mux(dm);
   if (!om)
@@ -1155,33 +1173,21 @@ static void _eit_install_handlers
   m = priv->module;
 
   tvhtrace(m->subsys, "handlers - detected module '%s'", m->id);
-  priv = (eit_private_t *)m->opaque;
-  pid = priv->pid;
-  opts = 0;
 
-  /* Standard (0x12) */
-  if (pid == 0) {
-    pid  = DVB_EIT_PID;
-    opts = MT_RECORD;
-  }
-
-  if (priv->hacks & EIT_HACK_EIT) {
-    m2 = (epggrab_module_ota_t *)epggrab_module_find_by_id("eit");
+  if (!strempty(priv->slave)) {
+    m2 = (epggrab_module_ota_t *)epggrab_module_find_by_id(priv->slave);
     if (m2 && m2->enabled) {
       LIST_FOREACH(map2, &om->om_modules, om_link)
         if (map2->om_module == m2)
          break;
       if (map2) {
-        mpegts_table_add(dm, 0, 0, _eit_callback, map2, map->om_module->id, LS_TBL_EIT,
-                         MT_CRC | MT_RECORD, DVB_EIT_PID, MPS_WEIGHT_EIT);
-        tvhdebug(m->subsys, "%s: installed table handler (pid %d)", m2->id, DVB_EIT_PID);
+        tvhtrace(m->subsys, "handlers - detected slave module '%s'", m2->id);
+        _eit_install_one_handler(dm, map2);
       }
     }
   }
 
-  mpegts_table_add(dm, 0, 0, _eit_callback, map, map->om_module->id, LS_TBL_EIT,
-                   MT_CRC | opts, pid, MPS_WEIGHT_EIT);
-  tvhdebug(m->subsys, "%s: installed table handler (pid %d)", m->id, pid);
+  _eit_install_one_handler(dm, map);
 }
 
 static int _eit_activate(void *m, int e)
@@ -1594,9 +1600,10 @@ static void eit_init_one ( const char *id, htsmsg_t *conf )
   map = htsmsg_get_map(conf, "hacks");
   if (map) {
     HTSMSG_FOREACH(f, map) {
-      if (strcmp(htsmsg_field_name(f), "eit") == 0)
-        priv->hacks |= EIT_HACK_EIT;
-      else if (strcmp(htsmsg_field_name(f), "interest-4e") == 0)
+      if (strcmp(htsmsg_field_name(f), "slave") == 0) {
+        s = htsmsg_field_get_str(f);
+        if (s) strncpy(priv->slave, s, sizeof(priv->slave) - 1);
+      } else if (strcmp(htsmsg_field_name(f), "interest-4e") == 0)
         priv->hacks |= EIT_HACK_INTEREST4E;
       else if (strcmp(htsmsg_field_name(f), "extra-mux-lookup") == 0)
         priv->hacks |= EIT_HACK_EXTRAMUXLOOKUP;