Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bouquets: add --nobat debug option
  • Loading branch information
perexg committed Nov 21, 2014
1 parent 6bcecff commit 3ba5bb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/input/mpegts/dvb_psi.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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' */
Expand Down Expand Up @@ -728,8 +734,6 @@ dvb_bskyb_local_channels
if (len < 2)
return;

assert(bi);

regionid = (ptr[1] != 0xff) ? ptr[1] : 0xffff;

#if 0
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1490,15 +1495,15 @@ dvb_nit_callback
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;
}
#endif
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;
}
Expand Down
8 changes: 7 additions & 1 deletion src/main.c
Expand Up @@ -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();

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 },

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3ba5bb9

Please sign in to comment.