]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
bouquets: add --nobat debug option
authorJaroslav Kysela <perex@perex.cz>
Fri, 21 Nov 2014 14:10:49 +0000 (15:10 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 21 Nov 2014 14:10:49 +0000 (15:10 +0100)
src/input/mpegts/dvb_psi.c
src/main.c

index 2dc0ff8dc39ec38aea4e596e7d94127ffeaa3dbd..6020d09fe9c8d7c5825bae59074f6325dbb5c57f 100644 (file)
@@ -81,6 +81,8 @@ typedef struct dvb_bat {
 
 SKEL_DECLARE(mpegts_table_state_skel, struct mpegts_table_state);
 
+int dvb_bouquets_parse = 1;
+
 static int
 psi_parse_pmt(mpegts_mux_t *mux, mpegts_service_t *t, const uint8_t *ptr, int len);
 
@@ -386,6 +388,7 @@ dvb_bat_find_service( dvb_bat_id_t *bi, mpegts_service_t *s,
 {
   dvb_bat_svc_t *bs;
 
+  assert(bi);
   TAILQ_FOREACH(bs, &bi->services, link)
     if (bs->svc == s)
       break;
@@ -525,6 +528,9 @@ dvb_freesat_regions
   dvb_freesat_region_t *fr;
   int r;
 
+  if (!bi)
+    return;
+
   while (len > 5) {
     id = (ptr[0] << 8) | ptr[1];
     /* language: ptr[2-4]: 'eng' */
@@ -728,8 +734,6 @@ dvb_bskyb_local_channels
   if (len < 2)
     return;
 
-  assert(bi);
-
   regionid = (ptr[1] != 0xff) ? ptr[1] : 0xffff;
 
 #if 0
@@ -1319,7 +1323,8 @@ dvb_nit_callback
   }
 
   /* BAT ID lookup */
-  if (tableid == 0x4A || tableid == DVB_FASTSCAN_NIT_BASE) {
+  if (dvb_bouquets_parse &&
+      (tableid == 0x4A || tableid == DVB_FASTSCAN_NIT_BASE)) {
     if ((b = mt->mt_bat) == NULL) {
       b = calloc(1, sizeof(*b));
       mt->mt_bat = b;
@@ -1490,7 +1495,7 @@ lcn:
           break;
         case DVB_DESC_FREESAT_LCN:
 #if ENABLE_MPEGTS_DVB
-          if (tableid == 0x4A && priv == PRIV_FSAT) {
+          if (bi && tableid == 0x4A && priv == PRIV_FSAT) {
             dvb_freesat_local_channels(bi, mt->mt_name, dptr, dlen);
             bi->freesat = 1;
           }
@@ -1498,7 +1503,7 @@ lcn:
           break;
         case DVB_DESC_BSKYB_LCN:
 #if ENABLE_MPEGTS_DVB
-          if (tableid == 0x4A && priv == 2) {
+          if (bi && tableid == 0x4A && priv == 2) {
             dvb_bskyb_local_channels(bi, mt->mt_name, dptr, dlen, mux);
             bi->bskyb = 1;
           }
index 3420fcf9c3d93e0b7f6ac7875a9a776ff8c79a5e..297cd0ecbfc87a5542370c5582fa535ea178d13f 100644 (file)
@@ -439,6 +439,7 @@ main(int argc, char **argv)
   const char *log_debug = NULL, *log_trace = NULL;
   char buf[512];
   FILE *pidfile = NULL;
+  extern int dvb_bouquets_parse;
 
   main_tid = pthread_self();
 
@@ -473,7 +474,8 @@ main(int argc, char **argv)
               opt_xspf         = 0,
               opt_dbus         = 0,
               opt_dbus_session = 0,
-              opt_nobackup     = 0;
+              opt_nobackup     = 0,
+              opt_nobat        = 0;
   const char *opt_config       = NULL,
              *opt_user         = NULL,
              *opt_group        = NULL,
@@ -552,6 +554,8 @@ main(int argc, char **argv)
     { 'D', "dump",      "Enable coredumps for daemon", OPT_BOOL, &opt_dump },
     {   0, "noacl",     "Disable all access control checks",
       OPT_BOOL, &opt_noacl },
+    {   0, "nobat",     "Disable DVB bouquets",
+      OPT_BOOL, &opt_nobat },
     { 'j', "join",      "Subscribe to a service permanently",
       OPT_STR, &opt_subscribe },
 
@@ -606,6 +610,8 @@ main(int argc, char **argv)
   }
 
   /* Additional cmdline processing */
+  if (opt_nobat)
+    dvb_bouquets_parse = 0;
 #if ENABLE_LINUXDVB
   if (!opt_dvb_adapters) {
     adapter_mask = ~0;